summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5c85d65)
raw | patch | inline | side by side (parent: 5c85d65)
author | acspike <acspike@users.sourceforge.net> | |
Thu, 20 Jul 2006 04:23:59 +0000 (04:23 +0000) | ||
committer | acspike <acspike@users.sourceforge.net> | |
Thu, 20 Jul 2006 04:23:59 +0000 (04:23 +0000) |
share/extensions/Makefile.am | patch | blob | history | |
share/extensions/markers_strokepaint.py | patch | blob | history | |
share/extensions/simplestyle.py | patch | blob | history |
index 1195266b1d0aeff5278a358371fada4c0fa97602..fc4297abcd139a73f1dd9cd3e37a90220be160f4 100644 (file)
flatten.py \
measure.py \
gimp_xcf.py \
- eqtexsvg.py
+ eqtexsvg.py \
+ markers_strokepaint.py
otherstuff = \
aisvg.xslt
gimp_xcf.inx \
randompnt.inx \
randompos.inx \
- eqtexsvg.inx
+ eqtexsvg.inx \
+ markers_strokepaint.inx
extension_SCRIPTS = \
$(extensions)
index f49a37a773d5f19ba12118579ee5768e4dc7ff8d..163767f1aaa4f5d423c16055eba39c4e5fa5dfd2 100644 (file)
self.ctx = inkex.xml.xpath.Context.Context(self.document,processorNss=inkex.NSS)\r
defs = self.xpathSingle('/svg/defs') \r
for id, node in self.selected.iteritems():\r
- mprops = ['marker-start','marker-mid','marker-end']\r
+ mprops = ['marker','marker-start','marker-mid','marker-end']\r
style = simplestyle.parseStyle(node.attributes.getNamedItem('style').value)\r
\r
try:\r
for mprop in mprops:\r
if style.has_key(mprop) and style[mprop] != 'none'and style[mprop][:5] == 'url(#':\r
marker_id = style[mprop][5:-1]\r
- old_mnode = self.xpathSingle('/svg/defs/marker[@id="%s"]' % marker_id)\r
+ old_mnode = self.xpathSingle('/svg//marker[@id="%s"]' % marker_id)\r
mnode = old_mnode.cloneNode(True)\r
new_id = "%s%s" % (marker_id,2)\r
style[mprop] = "url(#%s)" % new_id\r
mnode.attributes.getNamedItem('id').value = new_id\r
defs.appendChild(mnode)\r
\r
- children = inkex.xml.xpath.Evaluate('/svg/defs/marker[@id="%s"]//*[@style]' % new_id,self.document,context=self.ctx)\r
+ children = inkex.xml.xpath.Evaluate('/svg//marker[@id="%s"]//*[@style]' % new_id,self.document,context=self.ctx)\r
for child in children:\r
+ inkex.debug(child.attributes.getNamedItem('style').value)\r
cstyle = simplestyle.parseStyle(child.attributes.getNamedItem('style').value)\r
if (cstyle.has_key('stroke') and cstyle['stroke'] != 'none') or not cstyle.has_key('stroke'):\r
cstyle['stroke'] = stroke\r
index 22b4c3e8b21d1ecc0dff56488f361d14a83ca540..e11f91ae0a0495a5b48ce05f6733377e46a52e78 100755 (executable)
"""
def parseStyle(s):
"""Create a dictionary from the value of an inline style attribute"""
- return dict([i.split(":") for i in s.split(";")])
+ return dict([i.split(":") for i in s.split(";") if len(i)])
def formatStyle(a):
"""Format an inline style attribute from a dictionary"""
return ";".join([":".join(i) for i in a.iteritems()])