summaryrefslogtreecommitdiff
path: root/giscanner/utils.py
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2013-04-24 14:06:18 +0200
committerDieter Verfaillie <dieterv@optionexplicit.be>2013-05-07 23:38:22 +0200
commitc9e2d880011c530ff1454fe31a2d40d189860be5 (patch)
tree9acdf7d7cf409ffd8d0f7967ebf9d03497d31269 /giscanner/utils.py
parenta031129d8ab28e2f51e95e7266f1274bdc592557 (diff)
downloadgobject-introspection-c9e2d880011c530ff1454fe31a2d40d189860be5.tar.gz
tests: Update misc/pep8.py to 1.4.5
Version in our tree is a wee bit outdated. For example, later work will introduce an utf8 encoded python source file which our old pep8.py does not yet understand (yeah, it really was *that* ancient)... Updated from: https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py Takes 552c1f1525e37a30376790151c1ba437776682c5, f941537d1c0a40f0906490ed160db6c79af572d3, 5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and a17f157e19bd6792c00321c8020dca5e5a281f45 into account... https://bugzilla.gnome.org/show_bug.cgi?id=699535
Diffstat (limited to 'giscanner/utils.py')
-rw-r--r--giscanner/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/giscanner/utils.py b/giscanner/utils.py
index 9adf6d93..77d05b9e 100644
--- a/giscanner/utils.py
+++ b/giscanner/utils.py
@@ -22,7 +22,10 @@ import re
import os
import subprocess
+
_debugflags = None
+
+
def have_debug_flag(flag):
"""Check for whether a specific debugging feature is enabled.
Well-known flags:
@@ -38,6 +41,7 @@ Well-known flags:
_debugflags.remove('')
return flag in _debugflags
+
def break_on_debug_flag(flag):
if have_debug_flag(flag):
import pdb
@@ -69,8 +73,10 @@ def to_underscores_noprefix(name):
name = _upperstr_pat2.sub(r'\1_\2', name)
return name
+
_libtool_pat = re.compile("dlname='([A-z0-9\.\-\+]+)'\n")
+
def _extract_dlname_field(la_file):
f = open(la_file)
data = f.read()
@@ -81,6 +87,7 @@ def _extract_dlname_field(la_file):
else:
return None
+
# Returns the name that we would pass to dlopen() the library
# corresponding to this .la file
def extract_libtool_shlib(la_file):
@@ -92,6 +99,7 @@ def extract_libtool_shlib(la_file):
# a path rather than the raw dlname
return os.path.basename(dlname)
+
def extract_libtool(la_file):
dlname = _extract_dlname_field(la_file)
if dlname is None:
@@ -104,6 +112,7 @@ def extract_libtool(la_file):
libname = libname.replace('.libs/.libs', '.libs')
return libname
+
# Returns arguments for invoking libtool, if applicable, otherwise None
def get_libtool_command(options):
libtool_infection = not options.nolibtool