Changeset 3172:6016ad4a8323 in livinglogic.python.xist

Show
Ignore:
Timestamp:
01/23/08 22:46:54 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add tghe abilitiy to pass through options to the docutils parser.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/ns/rest.py

    r3168 r3172  
    10021002 
    10031003 
    1004 def fromstring(string): 
    1005     doc = core.publish_doctree(string) 
     1004def fromstring(string, **options): 
     1005    doc = core.publish_doctree(string, settings_overrides=options) 
    10061006    elements = globals() 
    10071007 
     
    10241024 
    10251025 
    1026 def fromstream(stream): 
    1027     return fromstring(stream.read()) 
    1028  
    1029  
    1030 def fromfile(filename): 
     1026def fromstream(stream, **options): 
     1027    return fromstring(stream.read(), **options) 
     1028 
     1029 
     1030def fromfile(filename, **options): 
    10311031        filename = os.path.expanduser(filename) 
    10321032        with contextlib.closing(open(filename, "rb")) as stream: 
    1033             return fromstream(stream) 
     1033            return fromstream(stream, **options)