summaryrefslogtreecommitdiff
path: root/giscanner/utils.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2008-08-09 13:07:11 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-08-09 13:07:11 +0000
commite48a8b65b61dade42f23a3549ceb1b08afbe227b (patch)
treef4893526b9a90ce2a272255b6c8b8902d515cd08 /giscanner/utils.py
parente714252256a2e0bbf47abeb38d83992069b3b17f (diff)
downloadgobject-introspection-e48a8b65b61dade42f23a3549ceb1b08afbe227b.tar.gz
PEP8ify
2008-08-09 Johan Dahlin <johan@gnome.org> * giscanner/__init__.py: * giscanner/ast.py: * giscanner/cgobject.py: * giscanner/gidlparser.py: * giscanner/gidlwriter.py: * giscanner/girparser.py: * giscanner/girwriter.py: * giscanner/glibast.py: * giscanner/glibtransformer.py: * giscanner/odict.py: * giscanner/sourcescanner.py: * giscanner/transformer.py: * giscanner/utils.py: * giscanner/xmlwriter.py: * tools/g-ir-scanner: PEP8ify svn path=/trunk/; revision=341
Diffstat (limited to 'giscanner/utils.py')
-rw-r--r--giscanner/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/giscanner/utils.py b/giscanner/utils.py
index 488baadd..22656536 100644
--- a/giscanner/utils.py
+++ b/giscanner/utils.py
@@ -26,6 +26,7 @@ _upperstr_pat1 = re.compile(r'([^A-Z])([A-Z])')
_upperstr_pat2 = re.compile(r'([A-Z][A-Z])([A-Z][0-9a-z])')
_upperstr_pat3 = re.compile(r'^([A-Z])([A-Z])')
+
def to_underscores(name):
"""Converts a typename to the equivalent underscores name.
This is used to form the type conversion macros and enum/flag
@@ -37,6 +38,7 @@ def to_underscores(name):
_libtool_pat = re.compile("dlname='([A-z0-9\.\-\+]+)'\n")
+
def resolve_libtool(libname):
data = open(libname).read()
filename = _libtool_pat.search(data).groups()[0]
@@ -44,10 +46,10 @@ def resolve_libtool(libname):
'.libs', filename)
return libname
+
def strip_common_prefix(first, second):
first_underscore = to_underscores(first)
for i, c in enumerate(first_underscore.upper()):
if c != second[i]:
break
return second[i:]
-