diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-09-23 16:05:45 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-09-25 11:00:48 +0200 |
commit | 4a9fdeb64bc87f09e44ecc0f9c6acaea8bf11f20 (patch) | |
tree | 41bb3585a34125aaa26408de78da312226a0bc7c /tools/glib-errors-str-gen.py | |
parent | 15f9b0e7259c46747326758d62c5a9ecb6ce3af2 (diff) | |
download | telepathy-logger-4a9fdeb64bc87f09e44ecc0f9c6acaea8bf11f20.tar.gz |
sync tools/ with tp-glib master
Needed to stop using deprecated API in generated code.
https://bugs.freedesktop.org/show_bug.cgi?id=69797
Diffstat (limited to 'tools/glib-errors-str-gen.py')
-rw-r--r-- | tools/glib-errors-str-gen.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tools/glib-errors-str-gen.py b/tools/glib-errors-str-gen.py index b2cf520..ddb1e16 100644 --- a/tools/glib-errors-str-gen.py +++ b/tools/glib-errors-str-gen.py @@ -3,7 +3,7 @@ import sys import xml.dom.minidom -from libtpcodegen import file_set_contents +from libtpcodegen import file_set_contents, u from libglibcodegen import NS_TP, get_docstring, xml_escape class Generator(object): @@ -17,18 +17,12 @@ class Generator(object): self.__docs = [] def h(self, s): - if isinstance(s, unicode): - s = s.encode('utf-8') self.__header.append(s) def b(self, s): - if isinstance(s, unicode): - s = s.encode('utf-8') self.__body.append(s) def d(self, s): - if isinstance(s, unicode): - s = s.encode('utf-8') self.__docs.append(s) def __call__(self): @@ -72,9 +66,9 @@ class Generator(object): self.h('') self.b('') - file_set_contents(self.basename + '.h', '\n'.join(self.__header)) - file_set_contents(self.basename + '.c', '\n'.join(self.__body)) - file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs)) + file_set_contents(self.basename + '.h', u('\n').join(self.__header).encode('utf-8')) + file_set_contents(self.basename + '.c', u('\n').join(self.__body).encode('utf-8')) + file_set_contents(self.basename + '-gtk-doc.h', u('\n').join(self.__docs).encode('utf-8')) if __name__ == '__main__': argv = sys.argv[1:] |