From b623e6de7f51f81d9a1b892d47323346d7ea56b1 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 11 Jun 2010 22:46:31 +0000 Subject: handles a filename as command-line parameter to update a single files only git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2495 b956fd51-792f-4845-bead-9b4dfca2ff2c --- game/languages/update.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'game') diff --git a/game/languages/update.py b/game/languages/update.py index f488b9d9..74b4b774 100755 --- a/game/languages/update.py +++ b/game/languages/update.py @@ -123,14 +123,18 @@ def update(lang): f.write(line + os.linesep) f.close() -# update ini-files -iniList=os.listdir(".") -for ini in iniList: - if not re.search(".ini$", ini): - continue - if ini == "English.ini": - continue - update(ini); +if len(sys.argv) >= 2: + # update specific language file passed as command-line argument + update(sys.argv[1]) +else: + # update all language (ini) files + iniList=os.listdir(".") + for ini in iniList: + if not re.search(".ini$", ini): + continue + if ini == "English.ini": + continue + update(ini); -# update template (do not use an .ini prefix as USDX would load it) -update("Language.new"); + # update template (do not use an .ini prefix as USDX would load it) + update("Language.new"); -- cgit v1.2.3