slight tweaks to booklist format
svn: r21718
This commit is contained in:
parent
93e95ad7da
commit
8835e3f133
@ -329,9 +329,10 @@ class BookList(object):
|
|||||||
f.write(' <item name="%s" trans_name="%s">\n' %
|
f.write(' <item name="%s" trans_name="%s">\n' %
|
||||||
(item.get_name(),item.get_translated_name() ) )
|
(item.get_name(),item.get_translated_name() ) )
|
||||||
options = item.option_class.handler.options_dict
|
options = item.option_class.handler.options_dict
|
||||||
for option_name, option_value in options.items():
|
for option_name in sorted(options.keys()): # enable a diff
|
||||||
|
option_value = options[option_name]
|
||||||
if isinstance(option_value, (list, tuple)):
|
if isinstance(option_value, (list, tuple)):
|
||||||
f.write(' <option name="%s" value="" '
|
f.write(' <option name="%s" value="" '
|
||||||
'length="%d">\n' % (
|
'length="%d">\n' % (
|
||||||
escape(option_name),
|
escape(option_name),
|
||||||
len(options[option_name]) ) )
|
len(options[option_name]) ) )
|
||||||
@ -339,21 +340,21 @@ class BookList(object):
|
|||||||
option_type = type_name(option_value[list_index])
|
option_type = type_name(option_value[list_index])
|
||||||
value = escape(cuni(option_value[list_index]))
|
value = escape(cuni(option_value[list_index]))
|
||||||
value = value.replace('"', '"')
|
value = value.replace('"', '"')
|
||||||
f.write(' <listitem number="%d" type="%s" '
|
f.write(' <listitem number="%d" type="%s" '
|
||||||
'value="%s"/>\n' % (
|
'value="%s"/>\n' % (
|
||||||
list_index,
|
list_index,
|
||||||
option_type,
|
option_type,
|
||||||
value ) )
|
value ) )
|
||||||
f.write(' </option>\n')
|
f.write(' </option>\n')
|
||||||
else:
|
else:
|
||||||
option_type = type_name(option_value)
|
option_type = type_name(option_value)
|
||||||
value = escape(cuni(option_value))
|
value = escape(cuni(option_value))
|
||||||
value = value.replace('"', '"')
|
value = value.replace('"', '"')
|
||||||
f.write(' <option name="%s" type="%s" '
|
f.write(' <option name="%s" type="%s" '
|
||||||
'value="%s"/>\n' % (
|
'value="%s"/>\n' % (
|
||||||
escape(option_name),
|
escape(option_name),
|
||||||
option_type,
|
option_type,
|
||||||
value) )
|
value) )
|
||||||
|
|
||||||
f.write(' <style name="%s"/>\n' % item.get_style_name() )
|
f.write(' <style name="%s"/>\n' % item.get_style_name() )
|
||||||
f.write(' </item>\n')
|
f.write(' </item>\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user