[telepathy-glib/master] Remove camelcase_to_lower, camelcase_to_upper

Simon McVittie simon.mcvittie at collabora.co.uk
Wed May 27 08:31:46 PDT 2009


    In the face of ambiguity, refuse the temptation to guess.
    -Tim Peters, /The Python Way/ (see `python -c "import this"`)
---
 tools/libglibcodegen.py |    2 --
 tools/libtpcodegen.py   |   26 --------------------------
 2 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/tools/libglibcodegen.py b/tools/libglibcodegen.py
index 129c179..0cf52a8 100644
--- a/tools/libglibcodegen.py
+++ b/tools/libglibcodegen.py
@@ -23,8 +23,6 @@ please make any changes there.
 
 from libtpcodegen import NS_TP, \
                          Signature, \
-                         camelcase_to_lower, \
-                         camelcase_to_upper, \
                          cmp_by_name, \
                          escape_as_identifier, \
                          get_by_path, \
diff --git a/tools/libtpcodegen.py b/tools/libtpcodegen.py
index 6391f1a..e5114b7 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)
-- 
1.5.6.5



More information about the telepathy-commits mailing list