Changeset 5367:3dce2467c1be in livinglogic.python.xist

Show
Ignore:
Timestamp:
02/26/13 10:56:27 (7 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

The db2ul4 script now supports a -w/--keepws argument.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r5365 r5367  
    3232 
    3333*   Dictionaries in UL4 now support the method ``update``. 
     34 
     35*   The ``db2ul4`` script now supports a ``-w``/``--keepws`` argument. 
    3436 
    3537*   The UL4 functions ``vars`` and ``get`` have been removed. 
  • src/ll/scripts/db2ul4.py

    r5366 r5367  
    103103import sys, os, argparse, codecs, keyword 
    104104 
    105 from ll import ul4c 
     105from ll import ul4c, misc 
    106106 
    107107 
     
    187187    p.add_argument("templates", metavar="template", help="templates to be used", nargs="+") 
    188188    p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for template sources (default %(default)s)", default="utf-8", metavar="ENCODING") 
     189    p.add_argument("-w", "--keepws", dest="keepws", help="Keep linefeeds and indentation in template source? (default %(default)s)", action=misc.FlagAction, default=True) 
    189190 
    190191    args = p.parse_args(args) 
     
    201202            if os.path.extsep in templatename: 
    202203                templatename = templatename.rpartition(os.extsep)[0] 
    203         template = ul4c.Template(templatestream.read(), fixname(templatename)) 
     204        template = ul4c.Template(templatestream.read(), fixname(templatename), keepws=args.keepws) 
    204205        # The first template is the main template 
    205206        if maintemplate is None: