Fix Inkscape extension files for 1.0
Use lowercase for bools Avoid empty gui-description strings Resolves #231
This commit is contained in:
parent
a0c04d10ca
commit
be74f553e6
|
@ -60,13 +60,15 @@ class Boxes2INX:
|
||||||
(name, max((len(l) for l in val))+10, len(val)+1, a.default)
|
(name, max((len(l) for l in val))+10, len(val)+1, a.default)
|
||||||
elif a.choices:
|
elif a.choices:
|
||||||
return (''' <param name="%s" type="enum" _gui-text="%s" gui-description=%s>\n'''
|
return (''' <param name="%s" type="enum" _gui-text="%s" gui-description=%s>\n'''
|
||||||
% (name, viewname, quoteattr(a.help or "")) +
|
% (name, viewname, quoteattr(a.help or viewname)) +
|
||||||
"".join(' <item value="%s"%s>%s</item>\n' %
|
"".join(' <item value="%s"%s>%s</item>\n' %
|
||||||
(e, ' selected="selected"' if e == a.default else "",
|
(e, ' selected="selected"' if e == a.default else "",
|
||||||
e) for e in a.choices) + ' </param>\n')
|
e) for e in a.choices) + ' </param>\n')
|
||||||
else:
|
else:
|
||||||
|
default = a.default
|
||||||
if isinstance(a.type, boxes.BoolArg):
|
if isinstance(a.type, boxes.BoolArg):
|
||||||
t = '"boolean"'
|
t = '"boolean"'
|
||||||
|
default = str(a.default).lower()
|
||||||
elif a.type is boxes.argparseSections:
|
elif a.type is boxes.argparseSections:
|
||||||
t = '"string"'
|
t = '"string"'
|
||||||
else:
|
else:
|
||||||
|
@ -74,7 +76,7 @@ class Boxes2INX:
|
||||||
float : '"float" precision="2"',
|
float : '"float" precision="2"',
|
||||||
str : '"string"',
|
str : '"string"',
|
||||||
}.get(a.type, '"string"')
|
}.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 viewname), 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"?>
|
||||||
|
|
Loading…
Reference in New Issue