Changeset 4437:6f3d4e845072 in livinglogic.python.xist

Show
Ignore:
Timestamp:
03/25/11 15:57:19 (9 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Fix typos in script documentation. Add examples. Bump version number.

Files:
9 modified

Legend:

Unmodified
Added
Removed
  • setup.py

    r4369 r4437  
    228228args = dict( 
    229229    name="ll-xist", 
    230     version="3.17.3", 
     230    version="3.18", 
    231231    description="Extensible HTML/XML generator, cross-platform templating language, Oracle utilities and various other tools", 
    232232    long_description=description, 
  • src/ll/scripts/db2ul4.py

    r4420 r4437  
    8989    <?code db = oracle["user/pwd@db"]?> 
    9090    <persons> 
    91         <?for p in db.iter["select id, firstname, lastname from person"]?> 
     91        <?for p in db.iter["select id, firstname, lastname from person order by 2, 1"]?> 
    9292            <person id="<?printx p.id?>"> 
    9393                <firstname><?printx p.firstname?></firstname> 
  • src/ll/scripts/ucat.py

    r4422 r4437  
    1212 
    1313""" 
     14Purpose 
     15------- 
     16 
    1417``ucat`` is a script for printing files. It is an URL-enabled version of the 
    1518``cat`` system command. Via :mod:`ll.url` and :mod:`ll.orasql` ``ucat`` supports 
     
    5457    $ ucat ssh://user@www.example.org/~/foo.txt 
    5558 
    56 Print the SQL source code of a procedure in an Oracle database:: 
     59Print the SQL source code of the procedure ``FOO`` in an Oracle database:: 
    5760 
    58     $ ucat oracle://user:pwd@oracle.example.org/procedure/foo 
     61    $ ucat oracle://user:pwd@oracle.example.org/procedure/FOO 
    5962 
    6063""" 
  • src/ll/scripts/ucp.py

    r4422 r4437  
    1212 
    1313""" 
     14Purpose 
     15------- 
     16 
    1417``ucp`` is a script that copies files/directory contents. It is an URL-enabled 
    1518version of the ``cp`` system command. Via :mod:`ll.url` and :mod:`ll.orasql` 
     
    2326 
    2427    ``urls`` 
    25         Two or more URLs. If more than two URLs are given or if the last URL refers 
    26         to a directory, the last URL is the target directory. All other sources 
    27         are copied into this target directory. Else one file is copied to another 
    28         file. 
     28        Two or more URLs. If more than two URLs are given or the last URL refers 
     29        to an existing directory, the last URL is the target directory. All other 
     30        sources are copied into this target directory. Else one file is copied 
     31        to another file. 
    2932 
    3033    ``-v``, ``--verbose`` : ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
    31         Give a report during the copy process about the files copied and their sizes. 
     34        Give a report during the copy process about the files copied and their 
     35        sizes. 
    3236 
    3337    ``-c``, ``--color`` : ``yes``, ``no`` or ``auto`` 
  • src/ll/scripts/uls.py

    r4422 r4437  
    1212 
    1313""" 
     14Purpose 
     15------- 
     16 
    1417``uls`` is a script that lists the content of directories. It is an URL-enabled 
    1518version of the ``ls`` system command. Via :mod:`ll.url` and :mod:`ll.orasql` 
     
    5053 
    5154    ``-P``, ``--padding`` : characters 
    52         The characters using for padding output in multicolumn or long format. 
     55        The characters used for padding output in multicolumn or long format. 
    5356 
    5457    ``-S``, ``--separator`` : characters 
     
    5861        Only URLs matching this regular expression will be output. 
    5962 
    60     ``-e``, ``--expression`` : regular expression 
     63    ``-e``, ``--exclude`` : regular expression 
    6164        URLs matching this regular expression will be not be output. 
    6265 
    6366    ``-a``, ``--all`` :  ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
    6467        Output dot files (i.e. files and directories whose name starts with a 
    65         ``.``). Not that the content of directories whose name start with a dot 
     68        ``.``). Note that the content of directories whose name start with a dot 
    6669        will still be listed. 
    6770 
  • src/ll/xist/scripts/__init__.py

    r4423 r4437  
    2020    ``tld2xsc`` 
    2121        ``tld2xsc`` converts a Java tag library description XML file to a skeleton 
    22         XIST namespace 
     22        XIST namespace. 
    2323 
    2424    ``doc2txt`` 
  • src/ll/xist/scripts/dtd2xsc.py

    r4435 r4437  
    1111 
    1212""" 
     13Purpose 
     14------- 
     15 
    1316``dtd2xsc`` is a script that helps create XIST namespace modules from DTDs. 
    1417It reads one or more DTDs and outputs a skeleton namespace module. 
    1518 
     19 
     20Options 
     21------- 
     22 
    1623``dtd2xsc`` supports the following options: 
    1724 
    1825    ``urls`` 
    19         Zerone or more URLs (or filenames) of DTDs to be parsed. If no URL is 
     26        Zero or more URLs (or filenames) of DTDs to be parsed. If no URL is 
    2027        given stdin will be read. 
    2128 
     
    5562 
    5663    .. _xmlproc: http://www.garshol.priv.no/download/software/xmlproc/ 
     64 
     65 
     66Example 
     67------- 
     68 
     69Suppose we have the following DTD file (named ``foo.dtd``):: 
     70 
     71    <?xml version="1.0" encoding="ISO-8859-1"?> 
     72    <!ELEMENT persons (person*)> 
     73    <!ELEMENT person (firstname?, lastname?)> 
     74    <!ATTLIST person id CDATA #REQUIRED> 
     75    <!ELEMENT firstname (#PCDATA)> 
     76    <!ELEMENT lastname (#PCDATA)> 
     77 
     78Then we can generate a skeleton XIST namespace from it with the following command:: 
     79 
     80    dtd2xsc ~/gurk.dtd -xhttp://xmlns.example.org/ -mfullall 
     81 
     82The output will be:: 
     83 
     84    # -*- coding: ascii -*- 
     85 
     86 
     87    from ll.xist import xsc, sims 
     88 
     89 
     90    xmlns = 'http://xmlns.example.org/' 
     91 
     92 
     93    class firstname(xsc.Element): xmlns = xmlns 
     94 
     95 
     96    class lastname(xsc.Element): xmlns = xmlns 
     97 
     98 
     99    class person(xsc.Element): 
     100        xmlns = xmlns 
     101        class Attrs(xsc.Element.Attrs): 
     102            class id(xsc.TextAttr): required = True 
     103 
     104 
     105    class persons(xsc.Element): xmlns = xmlns 
     106 
     107 
     108    person.model = sims.Elements(lastname, firstname) 
     109    persons.model = sims.Elements(person) 
     110    firstname.model = sims.NoElements() 
     111    lastname.model = sims.NoElements() 
    57112""" 
    58113 
     
    211266    p.add_argument("-x", "--xmlns", dest="defaultxmlns", metavar="NAME", help="the namespace name for this module") 
    212267    p.add_argument("-s", "--shareattrs", dest="shareattrs", help="Should identical attributes be shared among elements? (default: %(default)s)", choices=("none", "dupes", "all"), default="dupes") 
    213     p.add_argument("-m", "--model", dest="model", default="once", help="Add sims information to the namespace (default: %(default)s)", choices=("no", "simple", "fullall", "fullonce")) 
     268    p.add_argument("-m", "--model", dest="model", default="fullonce", help="Add sims information to the namespace (default: %(default)s)", choices=("no", "simple", "fullall", "fullonce")) 
    214269    p.add_argument("-d", "--defaults", dest="defaults", help="Output default values for attributes? (default: %(default)s)", action=misc.FlagAction, default=False) 
    215270    p.add_argument(      "--duplicates", dest="duplicates", help="How to handle duplicate elements from multiple DTDs (default: %(default)s)", choices=("reject", "allow", "merge"), default="reject") 
  • src/ll/xist/scripts/tld2xsc.py

    r4436 r4437  
    1111 
    1212""" 
     13Purpose 
     14------- 
     15 
    1316``tld2xsc`` is a script that converts a JSP Tag Library Descriptor XML file 
    1417into a skeleton XIST namespace module. The tld file is read from stdin and 
    1518the namespace module is printed to stdout. 
     19 
     20 
     21Options 
     22------- 
    1623 
    1724``tld2xsc`` supports the following options: 
  • src/ll/xist/scripts/xml2xsc.py

    r4433 r4437  
    1111 
    1212""" 
     13Purpose 
     14------- 
     15 
    1316``xml2xsc`` is a script that generates an XIST namespace module from one or more 
    1417XML files. ``xml2xsc`` will output an XIST element class for each element it 
     
    1720element in the XML files, so the XML files should cover as many different cases 
    1821as possible. 
     22 
     23 
     24Options 
     25------- 
    1926 
    2027``xml2xsc`` supports the following options: 
     
    4855 
    4956    .. _lxml: http://lxml.de/ 
     57 
     58 
     59Example 
     60------- 
     61 
     62Suppose we have the following XML file (named ``foo.xml``):: 
     63 
     64    <x a="0"><x b="1"/><y/></x> 
     65 
     66Then we can generate a skeleton XIST namespace from it with the following command:: 
     67 
     68    xml2xsc foo.xml -xhttp://xmlns.example.org/ -mfullonce 
     69 
     70The output will be:: 
     71 
     72    # -*- coding: ascii -*- 
     73 
     74 
     75    from ll.xist import xsc, sims 
     76 
     77 
     78    xmlns = 'http://xmlns.example.org/' 
     79 
     80 
     81    class x(xsc.Element): 
     82        xmlns = xmlns 
     83        class Attrs(xsc.Element.Attrs): 
     84            class a(xsc.TextAttr): pass 
     85            class b(xsc.TextAttr): pass 
     86 
     87 
     88    class y(xsc.Element): xmlns = xmlns 
     89 
     90 
     91    x.model = sims.Elements(y, x) 
     92    y.model = sims.Empty() 
    5093""" 
    5194