summaryrefslogtreecommitdiff
path: root/giscanner/utils.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-03-16 18:25:19 -0400
committerColin Walters <walters@verbum.org>2009-03-17 11:10:04 -0400
commite9dcc3cfb985292b5ff96772b73029a32b18ff11 (patch)
tree7c235feb39b547a3829c12f64972b071d93dd7fa /giscanner/utils.py
parent1d1cc8c35364f9da12620c1925483b61dc688718 (diff)
downloadgobject-introspection-e9dcc3cfb985292b5ff96772b73029a32b18ff11.tar.gz
Bug 575613 - Enum stripping with common prefix, also use "_" consistently
Some enums have members which have a common prefix which doesn't match that of the enum name, but it also longer than the global namespace prefix. Instead, try stripping the common prefix first, and only if that fails fall back to the global strip. Also, for glib-registered enums we were using the nick, which typically has "-" as a separator. Replace that with "_" for consistency between unregistered enums and registered. utils.py:strip_common_prefix is now unused, delete.
Diffstat (limited to 'giscanner/utils.py')
-rw-r--r--giscanner/utils.py11
1 files changed, 0 insertions, 11 deletions
diff --git a/giscanner/utils.py b/giscanner/utils.py
index 021ffea2..d2752e7b 100644
--- a/giscanner/utils.py
+++ b/giscanner/utils.py
@@ -57,14 +57,3 @@ def extract_libtool(libname):
# and pre-2.2. Johan 2008-10-21
libname = libname.replace('.libs/.libs', '.libs')
return libname
-
-
-def strip_common_prefix(first, second):
- max_index = second.rfind('_')
- second_len = len(second)
- second = second.replace('_', '')
- max_index -= second_len - len(second) - 1
- for i, c in enumerate(first.upper()):
- if i >= len(second) or c != second[i] or i == max_index:
- return second[i:]
- return second[i + 1:]