Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added BUILD_VERSION (passive or urgent) to settings.py. Can be overwr…

…itten with command line arg.
  • Loading branch information...
commit 9c8da11112b01f9ac5d11f7f3af132c07760cb3e 1 parent 07fca47
Jon Petto authored April 03, 2012
18  README.md
Source Rendered
@@ -18,18 +18,26 @@ The localization files live in SVN. Check them out into the subdirectory
18 18
     cd fx36start
19 19
     svn checkout https://svn.mozilla.org/projects/l10n-misc/trunk/fx36start/locale/
20 20
 
  21
+### Choosing a build version
  22
+
  23
+Specify a version to build in settings.py. Available versions are 'passive' and 'urgent'.
  24
+'Passive' is the default.
  25
+
21 26
 ### Generating output files
22 27
 
23  
-Specify a version (passive or urgent) and an output directory (it shouldn't be
24  
-the same directory as the repo) and allow a few seconds for the script to scrape
25  
-Mozilla's FTP server.
  28
+Specify an output directory (it shouldn't be the same directory as the repo) and allow
  29
+a few seconds for the script to scrape Mozilla's FTP server.
26 30
 
27  
-    ./generate.py --version passive --output-dir html
  31
+    ./generate.py --output-dir html
28 32
 
29 33
 To delete the output dir before generating the output (careful!), use
30 34
 the --force option.
31 35
 
32  
-    ./generate.py --version passive --output-dir html -f
  36
+    ./generate.py --output-dir html -f
  37
+
  38
+The build version can be overwritten with the --version command line argument.
  39
+
  40
+    ./generate.py --version urgent --output-dir html -f
33 41
 
34 42
 ### Extracting .lang files
35 43
 
12  generate.py
@@ -39,7 +39,7 @@
39 39
                      default=True, help=("Don't warn if unknown L10n strings "
40 40
                                          "are encountered"))
41 41
 optparser.add_option('-v', '--version', action='store', dest='version',
42  
-                    default='passive', help="Version to generate. Accepts 'passive' or 'urgent'")
  42
+                    default='', help="Version to generate. Accepts 'passive' or 'urgent'")
43 43
 (options, args) = optparser.parse_args()
44 44
 
45 45
 OUTPUT_PATH = (options.output_path if options.output_path else
@@ -64,7 +64,13 @@ def main():
64 64
     """Function run when script is run from the command line."""
65 65
     template = ENV.get_template('index.html')
66 66
 
67  
-    sys.stdout.write("Writing %s template to %s\n" % (options.version, OUTPUT_PATH))
  67
+    # allow parameter to override settings build version
  68
+    if options.version != '':
  69
+        build_version = options.version
  70
+    else:
  71
+        build_version = settings.BUILD_VERSION
  72
+
  73
+    sys.stdout.write("Writing %s template to %s\n" % (build_version, OUTPUT_PATH))
68 74
 
69 75
     if os.path.exists(OUTPUT_PATH):
70 76
         if not options.force:
@@ -99,7 +105,7 @@ def main():
99 105
         data = {
100 106
             'LANG': lang,
101 107
             'DIR': 'rtl' if lang in settings.RTL_LANGS else 'ltr',
102  
-            'VERSION': options.version,
  108
+            'VERSION': build_version,
103 109
         }
104 110
 
105 111
         # Load _() translation shortcut for jinja templates and point it to dotlang.
3  settings.py
@@ -41,3 +41,6 @@
41 41
     'oc': 'fr',
42 42
     #'ta': 'FIXME'
43 43
 }
  44
+
  45
+# View to build - specify either 'passive' or 'urgent'
  46
+BUILD_VERSION = 'passive'

0 notes on commit 9c8da11

Please sign in to comment.
Something went wrong with that request. Please try again.