Hello everybody!

This is for qooxdoo 0.7.x.

I'm in need of using a charting library (flotr) which is based on prototype.

generator.py uses the $ sign as a prefix for optimized variables like $1, $2 etc which clashes with the $ notation of prototype in the build version.

I've found the location where the prefix "$" is set in generator.py and managed to introduce a new option for the optimizer:

 --optimize-variables-prefix

which then may be used to add a prefix befor 1, 2, 3 etc. in the optimized variable name.

I'm using this as follows:

   --optimize-variables-prefix=_

so now the generator creates variable names like $_1, $_2 etc. which do not clash anymore with prototype.

A patch against rev. 18378 of  branches/legacy_0_7_x/qooxdoo is attached.

--
Mit freundlichen Grüßen
Dietrich Streifert
--
Visionet GmbH
Firmensitz: Am Weichselgarten 7, 91058 Erlangen
Registergericht: Handelsregister Fürth, HRB 6573
Geschäftsführer: Stefan Lindner



Index: qooxdoo/frontend/framework/tool/generator.py
===================================================================
--- qooxdoo/frontend/framework/tool/generator.py        (revision 18378)
+++ qooxdoo/frontend/framework/tool/generator.py        (working copy)
@@ -104,6 +104,7 @@
     group.add_option("--add-file-ids", action="store_true", dest="addFileIds", 
default=False, help="Add file IDs to compiled output.")
     group.add_option("--optimize-strings", action="store_true", 
dest="optimizeStrings", default=False, help="Optimize strings. Increase mshtml 
performance.")
     group.add_option("--optimize-variables", action="store_true", 
dest="optimizeVariables", default=False, help="Optimize variables. Reducing 
size.")
+    group.add_option("--optimize-variables-prefix", action="store", 
dest="optimizeVariablesPrefix", metavar="PREFIX", default="", help="Use PREFIX 
for variable optimization.")
     group.add_option("--optimize-variables-skip-prefix", action="store", 
dest="optimizeVariablesSkipPrefix", metavar="PREFIX", default="", help="Skip 
optimization of variables beginning with PREFIX [default: optimize all 
variables].")
     group.add_option("--optimize-base-call", action="store_true", 
dest="optimizeBaseCall", default=False, help="Optimize call to 'this.base'. 
Optimizing runtime of super class calls.")
     group.add_option("--optimize-private", action="store_true", 
dest="optimizePrivate", default=False, help="Optimize private members. Reducing 
size and testing private.")
@@ -787,7 +788,7 @@
 
             counter += variableoptimizer.search(
                 loader.getTree(fileDb, fileId, options),
-                [], 0, 0, "$",
+                [], 0, 0, "$" + options.optimizeVariablesPrefix,
                 skipPrefix = options.optimizeVariablesSkipPrefix,
                 verbose = options.verbose
             )
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to