aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Chornoivan <yurchor@ukr.net>2014-01-20 20:14:19 +0200
committerYuri Chornoivan <yurchor@ukr.net>2014-01-20 20:14:30 +0200
commitae2a53476c15556413bfac101c6e62a6aacf65e3 (patch)
treece97b580ceb660b3bcdccc2e69c0f7e49a826bf1
parentd82e7c8cba8d963973a1e345cfb90ee1803e0efb (diff)
downloadtools-ae2a53476c15556413bfac101c6e62a6aacf65e3.tar
tools-ae2a53476c15556413bfac101c6e62a6aacf65e3.tar.gz
tools-ae2a53476c15556413bfac101c6e62a6aacf65e3.tar.bz2
tools-ae2a53476c15556413bfac101c6e62a6aacf65e3.tar.xz
tools-ae2a53476c15556413bfac101c6e62a6aacf65e3.zip
Add WebDAV capabilities
-rw-r--r--docs/images/images.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/docs/images/images.py b/docs/images/images.py
index 5c8b2ca4..261ebc5a 100644
--- a/docs/images/images.py
+++ b/docs/images/images.py
@@ -8,9 +8,10 @@ def usage():
print 'Options: -h, --help : usage'
print ' -l <locale>, --locale=<locale> : locale to test (default is "uk")'
print ' -d <docs>, --docs=<docs> : docs to test (installer (default) or mcc)'
+ print ' -s <source>, --source=<source> : source (webdav (default) or svn)'
sys.exit(2)
try:
- opts, args = getopt.getopt(sys.argv[1:], "hd:l:", ["help", "docs=", "locale="])
+ opts, args = getopt.getopt(sys.argv[1:], "hd:l:s:", ["help", "docs=", "locale=", "source="])
except getopt.GetoptError as err:
print str(err)
usage() # print help information and exit
@@ -18,6 +19,7 @@ except getopt.GetoptError as err:
docs = ''
locale = ''
+source = ''
for o,a in opts:
if o in ("-h", "--help"):
@@ -26,6 +28,8 @@ for o,a in opts:
docs=a
elif o in ("-l", "--locale"):
locale=a
+ elif o in ("-s", "--source"):
+ source=a
if docs == '':
docs = 'installer'
@@ -33,11 +37,15 @@ if docs == '':
if locale == '':
locale = 'uk'
-command_template = "svn list svn://svn.mageia.org/svn/soft/mageia-doc/trunk/%s/%s/images/ -R"
+if source == 'svn':
+ command_template = "svn list svn://svn.mageia.org/svn/soft/mageia-doc/trunk/%s/%s/images/ -R"
+ download_command = command_template %(docs, locale)
+else:
+ command_template = "kioclient ls webdav://vargas.calenco.com:8284/workspaces/Documentation/content/%s/"
+ download_command = command_template %locale
existing_images = []
-download_command = command_template %(docs, locale)
proc = subprocess.Popen(download_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
while True:
line = proc.stdout.readline()
@@ -46,8 +54,6 @@ while True:
else:
break
-#print "\n".join(existing_images)
-
if docs == 'installer':
po_url = "http://gitweb.mageia.org/software/i18n/tools/plain/docs/installer/%s.po" %locale
if docs == 'mcc':
@@ -58,16 +64,15 @@ po_text = response.read().replace('\"\n\"','')
dirty_list = []
-regexpression='[a-zA-Z0-9_-]{1,}\.png'
+regexpression='[\w-]{1,}\.png'
such=re.compile(regexpression,re.DOTALL)
for image in such.findall(po_text):
image_name = image.strip('')
- #print image_name
#add image_name
if not(image_name in existing_images):
dirty_list.append(image)
list = sorted(set(dirty_list))
-print 'Missing images for the %s docs (locale %s):\n-------------------------------\n' %(docs, locale)
+print 'Missing images for the %s docs (locale %s):\n-------------------------------' %(docs, locale)
print "\n".join(list)
-print '------------------------------'
+print '-------------------------------'