aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Chornoivan <yurchor@ukr.net>2014-01-20 07:50:02 +0200
committerYuri Chornoivan <yurchor@ukr.net>2014-01-20 07:50:02 +0200
commit5fed7c1d8364f4f1cc13d47a8f2b34784000170c (patch)
treeaaebf33ee34730e8cbe983d1e10441224111725e
parent65ab023991d86fd9e707ea3005a9a4c2013e5198 (diff)
downloadtools-5fed7c1d8364f4f1cc13d47a8f2b34784000170c.tar
tools-5fed7c1d8364f4f1cc13d47a8f2b34784000170c.tar.gz
tools-5fed7c1d8364f4f1cc13d47a8f2b34784000170c.tar.bz2
tools-5fed7c1d8364f4f1cc13d47a8f2b34784000170c.tar.xz
tools-5fed7c1d8364f4f1cc13d47a8f2b34784000170c.zip
Fix the script
-rw-r--r--docs/images/images.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/docs/images/images.py b/docs/images/images.py
index 85344c74..5c8b2ca4 100644
--- a/docs/images/images.py
+++ b/docs/images/images.py
@@ -6,13 +6,15 @@ def usage():
print '\nUsage: python %s [OPTION]' %os.path.basename(sys.argv[0])
print ' Show the list of missing images for given locale and docs name'
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 ' -l <locale>, --locale=<locale> : locale to test (default is "uk")'
+ print ' -d <docs>, --docs=<docs> : docs to test (installer (default) or mcc)'
sys.exit(2)
try:
- opts, args = getopt.getopt(sys.argv[1:], "hld:", ["help", "locale=", "docs="])
-except getopt.GetoptError:
+ opts, args = getopt.getopt(sys.argv[1:], "hd:l:", ["help", "docs=", "locale="])
+except getopt.GetoptError as err:
+ print str(err)
usage() # print help information and exit
+ sys.exit(2)
docs = ''
locale = ''
@@ -20,9 +22,9 @@ locale = ''
for o,a in opts:
if o in ("-h", "--help"):
usage()
- if o in ("-d", "--docs"):
+ elif o in ("-d", "--docs"):
docs=a
- if o in ("-l", "--locale"):
+ elif o in ("-l", "--locale"):
locale=a
if docs == '':
@@ -44,6 +46,8 @@ 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,9 +62,12 @@ regexpression='[a-zA-Z0-9_-]{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 "\n".join(list)
+print '------------------------------'