boxes2inkscape: Execute boxes directly, add dependency

Default to str as type of inputs
This commit is contained in:
Florian Festi 2017-02-25 19:45:55 +01:00
parent 174b20fc11
commit 5ef277fc21
1 changed files with 3 additions and 3 deletions

View File

@ -73,19 +73,19 @@ class Boxes2INX:
t = { int : "int", t = { int : "int",
float : "float", float : "float",
str : "string", str : "string",
}.get(a.type, a.type) }.get(a.type, "string")
return ''' <param name="%s" type="%s" max="9999" _gui-text="%s" gui-description=%s>%s</param>\n''' % (name, t, viewname, quoteattr(a.help or ""), a.default) return ''' <param name="%s" type="%s" max="9999" _gui-text="%s" gui-description=%s>%s</param>\n''' % (name, t, viewname, quoteattr(a.help or ""), a.default)
def generator2inx(self, name, box): def generator2inx(self, name, box):
result = [ """<?xml version="1.0" encoding="UTF-8"?> result = [ """<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> <inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>%s</_name> <_name>%s</_name>
<dependency type="executable" location="path">boxes</dependency>
<id>info.festi.boxes.py.%s</id> <id>info.festi.boxes.py.%s</id>
<param name="generator" type="string" gui-hidden="true">%s</param> <param name="generator" type="string" gui-hidden="true">%s</param>
<param name="tab" type="notebook"> <param name="tab" type="notebook">
""" % (name, name, name.lower())] """ % (name, name, name.lower())]
# <dependency type="executable" location="[extensions|path|plugins|{location}]">boxes</dependency>
groupid = 0 groupid = 0
for group in box.argparser._action_groups: for group in box.argparser._action_groups:
if not group._group_actions: if not group._group_actions:
@ -111,7 +111,7 @@ class Boxes2INX:
</effects-menu> </effects-menu>
</effect> </effect>
<script> <script>
<command reldir="extensions" interpreter="python">boxes</command> <command reldir="extensions">boxes</command>
</script> </script>
</inkscape-extension> </inkscape-extension>
""" % self.groups_by_name[box.ui_group].title) """ % self.groups_by_name[box.ui_group].title)