summaryrefslogtreecommitdiff
path: root/giscanner/codegen.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/codegen.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/codegen.py')
-rw-r--r--giscanner/codegen.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/giscanner/codegen.py b/giscanner/codegen.py
index b73a7da3..e9ed9415 100644
--- a/giscanner/codegen.py
+++ b/giscanner/codegen.py
@@ -24,6 +24,7 @@ from contextlib import contextmanager
from . import ast
+
class CCodeGenerator(object):
def __init__(self, namespace, out_h_filename, out_c_filename):
self.out_h_filename = out_h_filename
@@ -36,15 +37,16 @@ class CCodeGenerator(object):
return '%s_%s' % (self.namespace.symbol_prefixes[0], name)
def _typecontainer_to_ctype(self, param):
- if (isinstance(param, ast.Parameter) and
- param.direction in (ast.PARAM_DIRECTION_OUT,
- ast.PARAM_DIRECTION_INOUT)):
+ if (isinstance(param, ast.Parameter)
+ and param.direction in (ast.PARAM_DIRECTION_OUT, ast.PARAM_DIRECTION_INOUT)):
suffix = '*'
else:
suffix = ''
- if (param.type.is_equiv((ast.TYPE_STRING, ast.TYPE_FILENAME)) and
- param.transfer == ast.PARAM_TRANSFER_NONE):
+
+ if (param.type.is_equiv((ast.TYPE_STRING, ast.TYPE_FILENAME))
+ and param.transfer == ast.PARAM_TRANSFER_NONE):
return "const gchar*" + suffix
+
return param.type.ctype + suffix
def _write_prelude(self, out, func):