diff options
| author | Aaron Spike <aaron@ekips.org> | 2008-01-05 20:48:18 +0000 |
|---|---|---|
| committer | acspike <acspike@users.sourceforge.net> | 2008-01-05 20:48:18 +0000 |
| commit | d86ae7d50d24dd5d2772dab3c7b7520e643a67aa (patch) | |
| tree | 399bb2ae81044074e34e705b66f7e3e4f17288dc | |
| parent | adding myself to TRANSLATORS (diff) | |
| download | inkscape-d86ae7d50d24dd5d2772dab3c7b7520e643a67aa.tar.gz inkscape-d86ae7d50d24dd5d2772dab3c7b7520e643a67aa.zip | |
add uri for xml namespace and use inkex.addNS() to add namespaces
partial fix for Bug #179770
(bzr r4396)
| -rw-r--r-- | share/extensions/gears.py | 4 | ||||
| -rwxr-xr-x | share/extensions/inkex.py | 17 | ||||
| -rw-r--r-- | share/extensions/lorem_ipsum.py | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/share/extensions/gears.py b/share/extensions/gears.py index 9a69bf06e..c60f63b83 100644 --- a/share/extensions/gears.py +++ b/share/extensions/gears.py @@ -149,14 +149,14 @@ class Gears(inkex.Effect): # Embed gear in group to make animation easier: # Translate group, Rotate path.
t = 'translate(' + str( self.view_center[0] ) + ',' + str( self.view_center[1] ) + ')'
- g_attribs = {'inkscape:label':'Gear' + str( teeth ),
+ g_attribs = {inkex.addNS('label','inkscape'):'Gear' + str( teeth ),
'transform':t } g = inkex.etree.SubElement(self.current_layer, 'g', g_attribs) # Create SVG Path for gear
style = { 'stroke': '#000000', 'fill': 'none' }
gear_attribs = {'style':simplestyle.formatStyle(style), 'd':path} - gear = inkex.etree.SubElement(g, 'svg:path', gear_attribs )
+ gear = inkex.etree.SubElement(g, inkex.addNS('path','svg'), gear_attribs )
e = Gears() e.affect() diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py index a4ffd8bd3..61cbacea8 100755 --- a/share/extensions/inkex.py +++ b/share/extensions/inkex.py @@ -23,13 +23,14 @@ import sys, copy, optparse, random, re #a dictionary of all of the xmlns prefixes in a standard inkscape doc NSS = { -u'sodipodi' :u'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd', -u'cc' :u'http://web.resource.org/cc/', -u'svg' :u'http://www.w3.org/2000/svg', -u'dc' :u'http://purl.org/dc/elements/1.1/', -u'rdf' :u'http://www.w3.org/1999/02/22-rdf-syntax-ns#', -u'inkscape' :u'http://www.inkscape.org/namespaces/inkscape', -u'xlink' :u'http://www.w3.org/1999/xlink' +u'sodipodi' :u'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd', +u'cc' :u'http://web.resource.org/cc/', +u'svg' :u'http://www.w3.org/2000/svg', +u'dc' :u'http://purl.org/dc/elements/1.1/', +u'rdf' :u'http://www.w3.org/1999/02/22-rdf-syntax-ns#', +u'inkscape' :u'http://www.inkscape.org/namespaces/inkscape', +u'xlink' :u'http://www.w3.org/1999/xlink', +u'xml' :u'http://www.w3.org/XML/1998/namespace' } #a dictionary of unit to user unit conversion factors @@ -55,7 +56,7 @@ def unittouu(string): try: from lxml import etree except: - sys.exit('The fantabulous lxml wrapper for libxml2 is required by inkex_lxml.py and therefore this extension. Please download the latest version from <http://cheeseshop.python.org/pypi/lxml/>.') + sys.exit('The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from <http://cheeseshop.python.org/pypi/lxml/>.') def debug(what): sys.stderr.write(str(what) + "\n") diff --git a/share/extensions/lorem_ipsum.py b/share/extensions/lorem_ipsum.py index f4e43108a..115ac4ace 100644 --- a/share/extensions/lorem_ipsum.py +++ b/share/extensions/lorem_ipsum.py @@ -220,9 +220,9 @@ class MyEffect(inkex.Effect): if found==0:
#inkex.debug('No "flowRoot" elements selected. Unable to add text.')
svg=self.document.getroot()
- gattribs = {'inkscape:label':'lorem ipsum','inkscape:groupmode':'layer'}
+ gattribs = {inkex.addNS('label','inkscape'):'lorem ipsum',inkex.addNS('groupmode','inkscape'):'layer'}
g=inkex.etree.SubElement(svg,inkex.addNS('g','svg'),gattribs)
- flowRoot=inkex.etree.SubElement(g,inkex.addNS('flowRoot','svg'),{'xml:space':'preserve'})
+ flowRoot=inkex.etree.SubElement(g,inkex.addNS('flowRoot','svg'),{inkex.addNS('space','xml'):'preserve'})
flowRegion=inkex.etree.SubElement(flowRoot,inkex.addNS('flowRegion','svg'))
rattribs = {'x':'0','y':'0','width':svg.get('width'),'height':svg.get('height')}
rect=inkex.etree.SubElement(flowRegion,inkex.addNS('rect','svg'),rattribs)
|
