summaryrefslogtreecommitdiff
path: root/giscanner/xmlwriter.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2008-04-28 02:12:17 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-04-28 02:12:17 +0000
commit552d1567eefc8a6515947a67d8abc0de3d578f61 (patch)
treee311f52c9441b7a23f2ba4d60b0f72c56a922d2d /giscanner/xmlwriter.py
parent08d6ab26956b8fcc443ca7b9162ee3fee0ed8af6 (diff)
downloadgobject-introspection-552d1567eefc8a6515947a67d8abc0de3d578f61.tar.gz
Include indentation in line length calculation
2008-04-27 Johan Dahlin <johan@gnome.org> * giscanner/xmlwriter.py: * tests/parser/Foo-expected.gir: Include indentation in line length calculation svn path=/trunk/; revision=239
Diffstat (limited to 'giscanner/xmlwriter.py')
-rw-r--r--giscanner/xmlwriter.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/giscanner/xmlwriter.py b/giscanner/xmlwriter.py
index 53926d7c..cfb8a774 100644
--- a/giscanner/xmlwriter.py
+++ b/giscanner/xmlwriter.py
@@ -32,17 +32,19 @@ class XMLWriter(object):
# 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