2008-04-27 Johan Dahlin <johan@gnome.org>
+ * giscanner/xmlwriter.py:
+ * tests/parser/Foo-expected.gir:
+ Include indentation in line length calculation
+
+2008-04-27 Johan Dahlin <johan@gnome.org>
+
* giscanner/girparser.py:
Prettify NS parsing using elementtree.
# Private
- def _calc_attrs_length(self, attributes):
+ def _calc_attrs_length(self, attributes, indent):
+ if indent == -1:
+ return -1
attr_length = 0
for attr, value in attributes:
attr_length += 1 + len(attr) + len(quoteattr(value))
- return attr_length
+ return attr_length + indent
def _collect_attributes(self, attributes, indent=-1):
if not attributes:
return ''
- if indent != -1 and self._calc_attrs_length(attributes) > 79:
+ if self._calc_attrs_length(attributes, indent) > 79:
indent_len = self._indent + indent
else:
indent_len = 0
<member name="FOO_ENUM_DEUX" value="2"/>
<member name="FOO_ENUM_TROIS" value="3"/>
</enumeration>
- <glib:boxed glib:name="Boxed" glib:type-name="FooBoxed" glib:get-type="foo_boxed_get_type">
+ <glib:boxed glib:name="Boxed"
+ glib:type-name="FooBoxed"
+ glib:get-type="foo_boxed_get_type">
<constructor name="new" c:identifier="foo_boxed_new">
<return-value c:identifer="Boxed*">
<type name="Boxed*"/>