Changeset 4436:b3c3ebbdfa3c in livinglogic.python.xist for src/ll/xist/scripts/tld2xsc.py

Show
Ignore:
Timestamp:
03/21/11 15:08:52 (8 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Remove defaults argument from tld2xsc. Add proper docstring to tld2xsc.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/scripts/tld2xsc.py

    r4422 r4436  
    1111 
    1212""" 
    13 Module that helps to create XIST namespace modules from TLD files (Java tag 
    14 library descriptors). 
     13``tld2xsc`` is a script that converts a JSP Tag Library Descriptor XML file 
     14into a skeleton XIST namespace module. The tld file is read from stdin and 
     15the namespace module is printed to stdout. 
    1516 
    16 For usage information type:: 
     17``tld2xsc`` supports the following options: 
    1718 
    18     $ tld2xsc --help 
     19    ``-s``, ``--shareattrs`` : ``none``, ``dupes``, ``all`` 
     20        Should attributes be shared among the elements? ``none`` means that each 
     21        element will have its own standalone :class:`Attrs` class directly derived 
     22        from :class:`ll.xist.Elements.Attrs`. For ``dupes`` each attribute that is 
     23        used by more than one element will be moved into its own :class:`Attrs` 
     24        class. For ``all`` this will be done for all attributes. 
     25 
     26    ``-m``, ``--model`` : ``no``, ``simple``, ``fullall``, ``fullonce`` 
     27        Add model information to the namespace. ``no`` doesn't add any model 
     28        information. ``simple`` only adds ``model = False`` or ``model = True`` 
     29        (i.e. only the information whether the element must be empty or not). 
     30        ``fullall`` adds a :mod:`ll.xist.sims` model object to each element class. 
     31        ``fullonce`` adds full model information to, but reuses model objects for 
     32        elements which have the same model. 
    1933""" 
    2034 
     
    5064    p.add_argument("-s", "--shareattrs", dest="shareattrs", help="Should identical attributes be shared among elements? (default %(default)s)", choices=("none", "dupes", "all"), default="dupes") 
    5165    p.add_argument("-m", "--model", dest="model", help="Add sims information to the namespace (default %(default)s)", choices=("none", "simple", "fullall", "fullonce"), default="simple") 
    52     p.add_argument("-d", "--defaults", dest="defaults", help="Output default values for attributes? (default %(default)s)", action=misc.FlagAction, default=False) 
    5366 
    5467    args = p.parse_args(args) 
    55     print makexnd(sys.stdin, args.shareattrs, model=args.model, defaults=args.defaults) 
     68    print makexnd(sys.stdin, args.shareattrs, model=args.model) 
    5669 
    5770