hi,

i originally only meant to make the options processor compatible with
waf, but i got a bit carried away and reimplemented the whole thing as
a reusable class/module.  the translator is the only one really using
it, but the builder and linker will follow.

https://github.com/pyjs/pyjs/pull/733

highlights:
 - 95% consistent
 - organized by group
 - displays defaults
 - automatic negatives (--no, --disable, --without)
 - proper negative groups
 - new language/opts
 - old opts hidden but available

... needs warnings for "deprecated" aliases, but i can add that a bit
later; mainly i want people to take a look at the options names, and
offer any corrections/improvements ... Kees, and others familiar w/the
translator, please make sure i got the help text right (some options
i'm not 100% what they actually *do*)

the new processor lets you do useless stuff like this:

# pyjsbuild --disable-default --no-speed

... which essentially inverts the defaults, and *sort of*
--enable[s]--strict, but it also lets you do some really useful
things, such as:

# pyjsbuild --enable-strict --disable-debug

... which --enable[s]-strict pythonic options, but then disables
anything that is also in the debug group (excessive tracking/storing
of python source, etc); this leads good python compat without bloating
the generated code.

if your have any suggestions, or any other comments lmk ... i'll merge
this soon as it's complete enough to refine in-tree.

------------------------------------------------------------------
# pyjsbuild --help
Usage: pyjsbuild [options] MODULE

Command line interface to the pyjs.org suite: Python Application ->
AJAX Application.
MODULE is the translation entry point; it MUST be importable by the toolchain.
For more information, see the website at http://pyjs.org/

Options:
  -h, --help            show this help message and exit
  -P PLATFORMS, --platforms=PLATFORMS
                        comma-separated list of target platforms
  -l LOG_LEVEL, --log-level=LOG_LEVEL
                        The python log level as an int
  -A, --auto-build      Runs continuous re-builds on file changes
  -i, --list-imports    List import dependencies (without compiling)
  -c, --cache-buster    Enable browser cache-busting (MD5 hash added to output
                        filenames)
  --apploader-file=APPLOADER_FILE
                        Specify the application html loader file.
  --bootstrap-file=BOOTSTRAP_FILE
                        Specify the bootstrap code. (Used when application
                        html file is generated).
  --public-folder=PUBLIC_FOLDER
                        Specifiy the public folder. (Contents copied into the
                        output dir, see -o).
  --no-compile-inplace  Store all js compiled files in output/lib
  --no-keep-lib-files   Deletes the js compiled files after linking
  --compile-inplace     Store js compiled files in the same place as the
                        python source
  --keep-lib-files      Keep the js compiled files

  Translator Options:
    Configures the semantics/bourdaries/expectations of the generated
    application code. --enable-OPTIONs are mirrored by --disable-OPTIONs.
    --enable-GROUPs and --disable-GROUPs modify several OPTIONs at once.

    -D, --enable-default
                        (group) enable DEFAULT options
    -d, --enable-debug  (group) enable DEBUG options
    -O, --enable-speed  (group) enable SPEED options, degrade STRICT
    -S, --enable-strict
                        (group) enable STRICT options, degrade SPEED
    --enable-accessor-proto
                        enable __get/set/delattr__() accessor protocol [True]
    --enable-bound-methods
                        enable proper method binding [True]
    --enable-check-args
                        enable function argument validation [False]
    --enable-check-attrs
                        enable attribute validation [False]
    --enable-descriptor-proto
                        enable __get/set/del__ descriptor protocol [False]
    --enable-inline-code
                        enable bool/eq/len inlining [False]
    --enable-locals     enable locals() [False]
    --enable-number-classes
                        enable float/int/long as classes [False]
    --enable-operator-funcs
                        enable operators-as-functions [True]
    --enable-print-statements
                        enable printing to console [True]
    --enable-store-sources
                        enable storing original sources in javascript [False]
    --enable-stupid-mode
                        enable minimalism by relying on javascript-isms
                        [False]
    --enable-track-lines
                        enable tracking original sources: every line [False]
    --enable-track-sources
                        enable tracking original sources [False]
    --enable-wrap-calls
                        enable call site debugging [False]
    --use-translator=TRANSLATOR
                        override translator [proto]

  Linker Options:
    Configures the includes/paths/destination of application code, static
    resources, and project support files.

    -o PATH, --output=PATH
                        directory to which the app should be written
    -I PATH, --search-path=PATH
                        additional paths appended to PYJSPATH
    -j FILE, --include-js=FILE
                        javascripts to load into the same frame as the rest of
                        the script
    --dynamic-link      shared modules linked BEFORE runtime, late-bind (ASYNC
                        <script>)
    --dynamic-load=REGEX
                        shared modules linked DURING runtime, on-demand; regex
                        (SYNC XHR)

------------------------------------------------------------------

C Anthony

Reply via email to