summaryrefslogtreecommitdiff
path: root/giscanner/xmlwriter.py
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2008-05-31 21:28:33 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-05-31 21:28:33 +0000
commit7a8c0642f5cc6e80e873f239984beeab7b9ba6ff (patch)
tree3253b638aafd973880c51593377fc2e263ac1566 /giscanner/xmlwriter.py
parentf8a4fe568bb27fe16b5b081464159549c7e10a57 (diff)
downloadgobject-introspection-7a8c0642f5cc6e80e873f239984beeab7b9ba6ff.tar.gz
Improve error reporting when trying to quote None. Do not print warnings
2008-05-31 Johan Dahlin <jdahlin@async.com.br> * giscanner/xmlwriter.py: Improve error reporting when trying to quote None. * giscanner/girparser.py: Do not print warnings when including more complete .gir files * giscanner/girwriter.py: Do not require a name for parameters, add a todo for singletons * giscanner/glibtransformer.py: Refactor the way structs are done, add a couple of hacks to allow us to get further. * giscanner/transformer.py: Add enough hacks so cairo, atk and pango.gir can be parsed properly * gobject-introspection-1.0.pc.in: Export girdir, so we can access gobject-2.0.gir from outside svn path=/trunk/; revision=280
Diffstat (limited to 'giscanner/xmlwriter.py')
-rw-r--r--giscanner/xmlwriter.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/giscanner/xmlwriter.py b/giscanner/xmlwriter.py
index b28d98c2..cbbbcbeb 100644
--- a/giscanner/xmlwriter.py
+++ b/giscanner/xmlwriter.py
@@ -38,6 +38,9 @@ class XMLWriter(object):
return -1
attr_length = 0
for attr, value in attributes:
+ if value is None:
+ raise ValueError(
+ "value for attribute %r cannot be None" % (attr,))
attr_length += 2 + len(attr) + len(quoteattr(value))
return attr_length + indent
@@ -54,7 +57,9 @@ class XMLWriter(object):
for attr, value in attributes:
if indent_len and not first:
attr_value += '\n%s' % (self._indent_char * indent_len)
- assert value is not None, attr
+ if value is None:
+ raise ValueError(
+ "value for attribute %r cannot be None" % (attr,))
attr_value += ' %s=%s' % (attr, quoteattr(value))
if first:
first = False