aboutsummaryrefslogtreecommitdiffstats
path: root/tools/glib-errors-str-gen.py
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-01-04 18:28:17 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-01-04 18:29:06 +0800
commit403ebcfcc6bcf95b1ef914de48ac5509c284b150 (patch)
tree347c425d2247a6125fb0bdff8acc9dbca804be0b /tools/glib-errors-str-gen.py
parent0aa79adae47a074f0fd59762eec0c133ca48ae2a (diff)
downloadgsoc2013-empathy-403ebcfcc6bcf95b1ef914de48ac5509c284b150.tar
gsoc2013-empathy-403ebcfcc6bcf95b1ef914de48ac5509c284b150.tar.gz
gsoc2013-empathy-403ebcfcc6bcf95b1ef914de48ac5509c284b150.tar.bz2
gsoc2013-empathy-403ebcfcc6bcf95b1ef914de48ac5509c284b150.tar.lz
gsoc2013-empathy-403ebcfcc6bcf95b1ef914de48ac5509c284b150.tar.xz
gsoc2013-empathy-403ebcfcc6bcf95b1ef914de48ac5509c284b150.tar.zst
gsoc2013-empathy-403ebcfcc6bcf95b1ef914de48ac5509c284b150.zip
sync tools/ with telepathy-glib
This should allow Empathy to be build with Python 3. https://bugzilla.gnome.org/show_bug.cgi?id=687616
Diffstat (limited to 'tools/glib-errors-str-gen.py')
-rw-r--r--tools/glib-errors-str-gen.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/tools/glib-errors-str-gen.py b/tools/glib-errors-str-gen.py
index b2cf520bd..ddb1e16b7 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:]