~ubuntu-branches/ubuntu/saucy/empathy/saucy-updates

« back to all changes in this revision

Viewing changes to tools/glib-client-gen.py

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2013-05-31 10:44:31 UTC
  • mfrom: (1.1.111) (6.6.55 experimental)
  • Revision ID: package-import@ubuntu.com-20130531104431-w0ec8ntcojx76y61
Tags: 3.8.3-0ubuntu1
* Merge with Debian, remaining changes:
  - debian/patches/00_linker-fixes.patch
  - debian/patches/10_use_notify_osd_icons.patch
  - debian/patches/23_idomessagedialog_for_voip_and_ft.patch
  - debian/patches/34_start_raised_execpt_in_session.patch
  - debian/patches/38_default_to_facebook_for_im.patch
  - debian/patches/39_default_to_freenode_for_irc.patch
  - debian/patches/41_unity_launcher_progress.patch
  - debian/patches/42_shell_running.patch
  - debian/patches/43_quicklists.patch
  - debian/patches/47_git_activate_with_platform_data.patch: Patches kept,
    see newly completed patch headers for descriptions.
  - debian/*: Turn on UOA and split out account plugins into
    account-plugins-* packages.
  - Remove Universe Build-Deps for geocode and cheese and disable these
    features.
  - debian/indicators/empathy: Install indicator integration point.
* New upstream release 3.8.3
* debian/patches/include-empathy-keyring.h: Add, fix implicit declaration of
  empathy_keyring_set_account_password_finish and co by including the right
  header.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import xml.dom.minidom
28
28
from getopt import gnu_getopt
29
29
 
30
 
from libtpcodegen import file_set_contents
31
 
from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \
 
30
from libtpcodegen import file_set_contents, key_by_name, u
 
31
from libglibcodegen import Signature, type_to_gtype, \
32
32
        get_docstring, xml_escape, get_deprecated
33
33
 
34
34
 
74
74
        self.guard = opts.get('--guard', None)
75
75
 
76
76
    def h(self, s):
77
 
        if isinstance(s, unicode):
78
 
            s = s.encode('utf-8')
79
77
        self.__header.append(s)
80
78
 
81
79
    def b(self, s):
82
 
        if isinstance(s, unicode):
83
 
            s = s.encode('utf-8')
84
80
        self.__body.append(s)
85
81
 
86
82
    def d(self, s):
87
 
        if isinstance(s, unicode):
88
 
            s = s.encode('utf-8')
89
83
        self.__docs.append(s)
90
84
 
91
85
    def get_iface_quark(self):
1191
1185
        self.b('')
1192
1186
 
1193
1187
        nodes = self.dom.getElementsByTagName('node')
1194
 
        nodes.sort(cmp_by_name)
 
1188
        nodes.sort(key=key_by_name)
1195
1189
 
1196
1190
        for node in nodes:
1197
1191
            self.do_interface(node)
1244
1238
            self.h('#endif /* defined (%s) */' % self.guard)
1245
1239
            self.h('')
1246
1240
 
1247
 
        file_set_contents(self.basename + '.h', '\n'.join(self.__header))
1248
 
        file_set_contents(self.basename + '-body.h', '\n'.join(self.__body))
1249
 
        file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs))
 
1241
        file_set_contents(self.basename + '.h', u('\n').join(self.__header).encode('utf-8'))
 
1242
        file_set_contents(self.basename + '-body.h', u('\n').join(self.__body).encode('utf-8'))
 
1243
        file_set_contents(self.basename + '-gtk-doc.h', u('\n').join(self.__docs).encode('utf-8'))
1250
1244
 
1251
1245
def types_to_gtypes(types):
1252
1246
    return [type_to_gtype(t)[1] for t in types]