Changeset 2537:dd19eebd49b8 in livinglogic.python.xist

Show
Ignore:
Timestamp:
06/01/06 12:32:34 (14 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add a method xml2mod() that turn an XML string into a module object.

Files:
1 modified

Legend:

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

    r2535 r2537  
    131131 
    132132 
    133 import datetime 
     133import datetime, new 
    134134 
    135135from ll.xist import xsc 
     
    266266 
    267267 
     268@classmethod 
     269def xml2mod(cls, source, name="venom"): 
     270    mod = new.module(name) 
     271    exec cls.xml2py(source) in mod.__dict__ 
     272    return mod 
     273 
     274 
    268275class __ns__(xsc.Namespace): 
    269276    xmlname = "pox"