diff options
author | Johan Dahlin <johan@gnome.org> | 2008-08-09 13:07:11 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-08-09 13:07:11 +0000 |
commit | e48a8b65b61dade42f23a3549ceb1b08afbe227b (patch) | |
tree | f4893526b9a90ce2a272255b6c8b8902d515cd08 /giscanner/xmlwriter.py | |
parent | e714252256a2e0bbf47abeb38d83992069b3b17f (diff) | |
download | gobject-introspection-e48a8b65b61dade42f23a3549ceb1b08afbe227b.tar.gz |
PEP8ify
2008-08-09 Johan Dahlin <johan@gnome.org>
* giscanner/__init__.py:
* giscanner/ast.py:
* giscanner/cgobject.py:
* giscanner/gidlparser.py:
* giscanner/gidlwriter.py:
* giscanner/girparser.py:
* giscanner/girwriter.py:
* giscanner/glibast.py:
* giscanner/glibtransformer.py:
* giscanner/odict.py:
* giscanner/sourcescanner.py:
* giscanner/transformer.py:
* giscanner/utils.py:
* giscanner/xmlwriter.py:
* tools/g-ir-scanner:
PEP8ify
svn path=/trunk/; revision=341
Diffstat (limited to 'giscanner/xmlwriter.py')
-rw-r--r-- | giscanner/xmlwriter.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/giscanner/xmlwriter.py b/giscanner/xmlwriter.py index 6c187a12..6b94a4d6 100644 --- a/giscanner/xmlwriter.py +++ b/giscanner/xmlwriter.py @@ -24,6 +24,7 @@ from xml.sax.saxutils import quoteattr class XMLWriter(object): + def __init__(self): self._data = StringIO() self._tag_stack = [] @@ -40,7 +41,7 @@ class XMLWriter(object): for attr, value in attributes: if value is None: raise ValueError( - "value for attribute %r cannot be None" % (attr,)) + "value for attribute %r cannot be None" % (attr, )) attr_length += 2 + len(attr) + len(quoteattr(value)) return attr_length + indent + self._indent @@ -58,7 +59,7 @@ class XMLWriter(object): attr_value += '\n%s' % (self._indent_char * indent_len) if value is None: raise ValueError( - "value for attribute %r cannot be None" % (attr,)) + "value for attribute %r cannot be None" % (attr, )) attr_value += ' %s=%s' % (attr, quoteattr(value)) if first: first = False @@ -70,7 +71,7 @@ class XMLWriter(object): self.write_line('<%s%s>' % (tag_name, attrs)) def _close_tag(self, tag_name): - self.write_line('</%s>' % (tag_name,)) + self.write_line('</%s>' % (tag_name, )) # Public API @@ -83,7 +84,7 @@ class XMLWriter(object): def write_tag(self, tag_name, attributes, data=None): if attributes is None: attributes = [] - prefix = '<%s' % (tag_name,) + prefix = '<%s' % (tag_name, ) if data is not None: suffix = '>%s</%s>' % (data, tag_name) else: @@ -122,7 +123,7 @@ def test(): ('value', '7'), ('c:identifier', 'GTK_ANCHOR_WEST'), ('glib:nick', 'west')]) - + w.pop_tag() w.pop_tag() w.pop_tag() |