[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r18011: {projects} Users can now choose their locale files src dir with -d DIR (projects/gettor)



Author: kaner
Date: 2009-01-07 11:31:00 -0500 (Wed, 07 Jan 2009)
New Revision: 18011

Modified:
   projects/gettor/gettor.py
   projects/gettor/gettor_opt.py
Log:
Users can now choose their locale files src dir with -d DIR


Modified: projects/gettor/gettor.py
===================================================================
--- projects/gettor/gettor.py	2009-01-07 16:26:30 UTC (rev 18010)
+++ projects/gettor/gettor.py	2009-01-07 16:31:00 UTC (rev 18011)
@@ -92,9 +92,8 @@
         return False
     return True
 
-def installTrans(config):
+def installTrans(config, localeSrcdir):
     hasDirs = None
-    localeSrcdir = "./i18n"
 
     if config is None:
         log.error("Bad arg.")
@@ -229,7 +228,7 @@
     localeDir = conf.getLocaleDir()
     # We need to do this first
     if options.insttrans:
-        if installTrans(conf):
+        if installTrans(conf, options.i18ndir):
             log.info("Installing translation files done.")
             success = True
         else:

Modified: projects/gettor/gettor_opt.py
===================================================================
--- projects/gettor/gettor_opt.py	2009-01-07 16:26:30 UTC (rev 18010)
+++ projects/gettor/gettor_opt.py	2009-01-07 16:31:00 UTC (rev 18011)
@@ -57,7 +57,11 @@
                         help="clear all entrys in the blacklist")
     cmdParser.add_option("-r", "--install-translations", dest="insttrans",
                         action="store_true", default=False,
-                        help="Compile and install translation files")
+                        help="Compile and install translation files [check -d]")
+    cmdParser.add_option("-d", "--i18n-dir", dest="i18ndir",
+                        default="./i18n",
+                        help="Set your locale src dir to DIR [default = %default]",
+                        metavar="DIR")
 
     return cmdParser.parse_args()