summaryrefslogtreecommitdiff
path: root/giscanner/scannermain.py
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-04-28 17:23:19 -0700
committerThomas A Caswell <tcaswell@gmail.com>2015-09-29 15:12:41 -0400
commit750060dc0211cfb5786ba39da7283e5885eac7ad (patch)
tree28337e94a44554ecf2c8263a8068e303f814b0dc /giscanner/scannermain.py
parent06166e54cea2302bf9213f18881495eb2b5d089d (diff)
downloadgobject-introspection-750060dc0211cfb5786ba39da7283e5885eac7ad.tar.gz
giscanner: Replace repr format usage with string formatter
Replace occurances of "%r" (repr) in format strings where the intended behaviour is to output a quoted string "'foo'" with explicit usage of "'%s'". This is needed to move the codebase to unicode literals in order to upgrade to Python 3. Python 2 unicode strings are expanded with repr formatting prefixed with a "u" as in "u'foo'" which causes failures for various text formatting scenarios. https://bugzilla.gnome.org/show_bug.cgi?id=679438
Diffstat (limited to 'giscanner/scannermain.py')
-rwxr-xr-xgiscanner/scannermain.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index b2b286f5..dd3f2b76 100755
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -275,7 +275,7 @@ def test_codegen(optstring,
include_last_src)
gen.write()
else:
- _error("Invaild namespace %r" % (namespace, ))
+ _error("Invaild namespace '%s'" % (namespace, ))
return 0
@@ -385,11 +385,11 @@ def create_transformer(namespace, options):
for include in options.includes:
if os.sep in include:
- _error("Invalid include path %r" % (include, ))
+ _error("Invalid include path '%s'" % (include, ))
try:
include_obj = Include.from_string(include)
except:
- _error("Malformed include %r\n" % (include, ))
+ _error("Malformed include '%s'\n" % (include, ))
transformer.register_include(include_obj)
for include_path in options.includes_uninstalled:
transformer.register_include_uninstalled(include_path)
@@ -454,7 +454,7 @@ def write_output(data, options):
with os.fdopen(temp_f, 'w') as temp_f:
passthrough_gir(main_f_name, temp_f)
if not utils.files_are_identical(main_f_name, temp_f_name):
- _error("Failed to re-parse gir file; scanned=%r passthrough=%r" % (
+ _error("Failed to re-parse gir file; scanned='%s' passthrough='%s'" % (
main_f_name, temp_f_name))
os.unlink(temp_f_name)
try: