aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libtpcodegen.py
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-02-01 21:47:58 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-02-01 22:22:39 +0800
commit621bbbb8631f4b149d0478a3423687e4e973b04f (patch)
tree5dc21cc9d4893343c50af7e8f109905ac6ae447e /tools/libtpcodegen.py
parent9503c4aa28b9a4215e3e325a31b500f2c78b712a (diff)
downloadgsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar
gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.gz
gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.bz2
gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.lz
gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.xz
gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.zst
gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.zip
Update tools from telepathy-glib
Diffstat (limited to 'tools/libtpcodegen.py')
-rw-r--r--tools/libtpcodegen.py36
1 files changed, 10 insertions, 26 deletions
diff --git a/tools/libtpcodegen.py b/tools/libtpcodegen.py
index 6391f1a48..837ff2f74 100644
--- a/tools/libtpcodegen.py
+++ b/tools/libtpcodegen.py
@@ -29,32 +29,6 @@ NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
_ASCII_ALNUM = ascii_letters + digits
-def camelcase_to_lower(s):
- out ="";
- out += s[0].lower()
- last_upper=False
- if s[0].isupper():
- last_upper=True
- for i in range(1,len(s)):
- if s[i].isupper():
- if last_upper:
- if (i+1) < len(s) and s[i+1].islower():
- out += "_" + s[i].lower()
- else:
- out += s[i].lower()
- else:
- out += "_" + s[i].lower()
- last_upper=True
- else:
- out += s[i]
- last_upper=False
- return out
-
-
-def camelcase_to_upper(s):
- return camelcase_to_lower(s).upper()
-
-
def cmp_by_name(node1, node2):
return cmp(node1.getAttributeNode("name").nodeValue,
node2.getAttributeNode("name").nodeValue)
@@ -146,6 +120,16 @@ def get_docstring(element):
docstring = ''
return docstring
+def get_deprecated(element):
+ text = []
+ for x in element.childNodes:
+ if hasattr(x, 'data'):
+ text.append(x.data.replace('\n', ' ').strip())
+ else:
+ # This caters for tp:dbus-ref elements, but little else.
+ if x.childNodes and hasattr(x.childNodes[0], 'data'):
+ text.append(x.childNodes[0].data.replace('\n', ' ').strip())
+ return ' '.join(text)
def get_descendant_text(element_or_elements):
if not element_or_elements: