Inkscape
Aus Vosp.info
Version vom 18. November 2013, 21:04 Uhr von F (Diskussion | Beiträge)
extension
xml element um tag erweitern
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>xml Attribute setzen</_name>
<id>org.inkscape.ancXmlAttribute</id>
<dependency type="executable" location="extensions">inkex.py</dependency>
<param name="kindof" type="enum" _gui-text="Attribut Wert">
<_item value="">...</_item>
<_item value="text">Text</_item>
<_item value="image">Bild</_item>
<_item value="qrcode">qrcode</_item>
<_item value="calendar">Kalender</_item>
</param>
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu _name="netz.coop"/>
</effects-menu>
</effect>
<script>
<command reldir="extensions" interpreter="python">ancXmlAttribute.py</command>
</script>
</inkscape-extension>
#!/usr/bin/env python
import sys
sys.path.append('/usr/share/inkscape/extensions')
import inkex
from simplestyle import *
class C(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
self.OptionParser.add_option(
"-k",
"--kindof",
action="store",
type="string",
dest="kindof",
default="text",
help="spv3 Objektart:"
)
def effect(self):
if self.selected:
for id, node in self.selected.iteritems():
node.set('ancXmlAttribute', self.options.kindof)
effect = C()
effect.affect()