summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5101aa9)
raw | patch | inline | side by side (parent: 5101aa9)
author | acspike <acspike@users.sourceforge.net> | |
Wed, 13 Sep 2006 02:13:14 +0000 (02:13 +0000) | ||
committer | acspike <acspike@users.sourceforge.net> | |
Wed, 13 Sep 2006 02:13:14 +0000 (02:13 +0000) |
share/extensions/inkex.py | patch | blob | history |
index e210e90c2d0dbf3e29615664ca702415f77bed40..1ce58d7417fdf58620475abd0d0c61ddaac842cd 100755 (executable)
try:
import xml.dom.ext
+ import xml.dom.minidom
import xml.dom.ext.reader.Sax2
import xml.xpath
except:
class Effect:
"""A class for creating Inkscape SVG Effects"""
- def __init__(self):
+ def __init__(self, *args, **kwargs):
self.id_characters = '0123456789abcdefghijklmnopqrstuvwkyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.document=None
self.ctx=None
self.doc_ids={}
self.options=None
self.args=None
+ self.use_minidom=kwargs.pop("use_minidom", False)
self.OptionParser = optparse.OptionParser(usage="usage: %prog [options] SVGfile",option_class=InkOption)
self.OptionParser.add_option("--id",
action="append", type="string", dest="ids", default=[],
stream = open(self.args[-1],'r')
except:
stream = sys.stdin
- self.document = reader.fromStream(stream)
+ if self.use_minidom:
+ self.document = xml.dom.minidom.parse(stream)
+ else:
+ self.document = reader.fromStream(stream)
self.ctx = xml.xpath.Context.Context(self.document,processorNss=NSS)
stream.close()
def getposinlayer(self):