From f4abcb7f662e8711c393b0402acb56a12186cfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sat, 1 Dec 2012 09:45:14 +0000 Subject: [PATCH] check defaults svn: r20715 --- po/update_po.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/po/update_po.py b/po/update_po.py index 114182d47..1e4eaad6f 100644 --- a/po/update_po.py +++ b/po/update_po.py @@ -346,7 +346,7 @@ def main(): 'also provides some common features.', ) parser.add_argument("-t", "--test", - action="store_true", dest="test", default=False, + action="store_true", dest="test", default=True, help="test if 'python' and 'gettext' are properly installed") parser.add_argument("-x", "--xml", @@ -368,11 +368,11 @@ def main(): # lang.po files maintenance update.add_argument("-m", "--merge", - type=int, dest="merge", default=[file for file in os.listdir('.')], + type=int, dest="merge", default=[file for file in os.listdir('.') if file.endswith('.po')], help="merge lang.po files with last catalog") update.add_argument("-k", "--check", - type=int, dest="check", default=[file for file in os.listdir('.')], + type=int, dest="check", default=[file for file in os.listdir('.') if file.endswith('.po')], help="check lang.po files") # testing stage @@ -389,6 +389,7 @@ def main(): args = parser.parse_args() + namespace, extra = parser.parse_known_args() #print(args, '\n\t\t###\n', vars(args), sys.argv[2:]) if args.test: @@ -409,10 +410,10 @@ def main(): if args.clean: clean() - if parser.get_default(merge): + if args.merge and sys.argv[2:] in namespace.merge: merge(sys.argv[2:]) - if parser.get_default(check): + if args.check and sys.argv[2:] in namespace.check: check(sys.argv[2:]) if args.untranslated and sys.argv[2:]: