Browse Source

Updated manage_translations script

Claude Paroz 9 năm trước cách đây
mục cha
commit
5172bdae57
1 tập tin đã thay đổi với 2 bổ sung5 xóa
  1. 2 5
      scripts/manage_translations.py

+ 2 - 5
scripts/manage_translations.py

@@ -168,14 +168,11 @@ if __name__ == "__main__":
     RUNABLE_SCRIPTS = ('update_catalogs', 'lang_stats', 'fetch')
     RUNABLE_SCRIPTS = ('update_catalogs', 'lang_stats', 'fetch')
 
 
     parser = ArgumentParser()
     parser = ArgumentParser()
-    parser.add_argument('cmd', nargs=1)
+    parser.add_argument('cmd', nargs=1, choices=RUNABLE_SCRIPTS)
     parser.add_argument("-r", "--resources", action='append',
     parser.add_argument("-r", "--resources", action='append',
         help="limit operation to the specified resources")
         help="limit operation to the specified resources")
     parser.add_argument("-l", "--languages", action='append',
     parser.add_argument("-l", "--languages", action='append',
         help="limit operation to the specified languages")
         help="limit operation to the specified languages")
     options = parser.parse_args()
     options = parser.parse_args()
 
 
-    if options.cmd[0] in RUNABLE_SCRIPTS:
+    eval(options.cmd[0])(options.resources, options.languages)
-        eval(options.cmd[0])(options.resources, options.languages)
-    else:
-        print("Available commands are: %s" % ", ".join(RUNABLE_SCRIPTS))