[gobject-introspection/wip/transformer] Reduce line length
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/wip/transformer] Reduce line length
- Date: Thu, 19 Aug 2010 15:00:25 +0000 (UTC)
commit d1dc5c617a5fa30d84647a425ebc62333eddc56e
Author: Johan Dahlin <johan gnome org>
Date: Thu Aug 19 11:51:16 2010 -0300
Reduce line length
giscanner/ast.py | 15 ++++++++++-----
giscanner/codegen.py | 8 +++++---
2 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/giscanner/ast.py b/giscanner/ast.py
index 2c76338..722bf42 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -146,11 +146,13 @@ TYPE_LONG = Type(target_fundamental='glong', ctype='glong')
TYPE_ULONG = Type(target_fundamental='gulong', ctype='gulong')
# C99 types
TYPE_LONG_LONG = Type(target_fundamental='long long', ctype='long long')
-TYPE_LONG_ULONG = Type(target_fundamental='unsigned long long', ctype='unsigned long long')
+TYPE_LONG_ULONG = Type(target_fundamental='unsigned long long',
+ ctype='unsigned long long')
TYPE_FLOAT = Type(target_fundamental='gfloat', ctype='gfloat')
TYPE_DOUBLE = Type(target_fundamental='gdouble', ctype='gdouble')
# ?
-TYPE_LONG_DOUBLE = Type(target_fundamental='long double', ctype='long double')
+TYPE_LONG_DOUBLE = Type(target_fundamental='long double',
+ ctype='long double')
TYPE_UNICHAR = Type(target_fundamental='gunichar', ctype='gunichar')
# C types with semantics overlaid
@@ -275,7 +277,8 @@ class Namespace(object):
if symbol_prefixes:
self.symbol_prefixes = symbol_prefixes
else:
- self.symbol_prefixes = map(lambda x: to_underscores(x).lower(), self.identifier_prefixes)
+ ps = self.identifier_prefixes
+ self.symbol_prefixes = [to_underscores(p).lower() for p in ps]
self._names = odict() # Maps from GIName -> node
self._aliases = {} # Maps from GIName -> GIName
self._type_names = {} # Maps from GTName -> node
@@ -345,7 +348,8 @@ identifier string."""
def float(self, node):
"""Like remove(), but doesn't unset the node's namespace
-back-reference, and it's still possible to look up functions via get_by_symbol()."""
+back-reference, and it's still possible to look up
+functions via get_by_symbol()."""
if isinstance(node, Function):
symbol = node.symbol
self.remove(node)
@@ -460,7 +464,8 @@ GIName. It's possible for nodes to contain or point to other nodes."""
def walk(self, callback, chain):
res = callback(self, chain)
- assert res in (True, False), "Walk function must return boolean, not %r" % (res, )
+ assert (res in (True, False),
+ "Walk function must return boolean, not %r" % (res, ))
if not res:
return False
chain.append(self)
diff --git a/giscanner/codegen.py b/giscanner/codegen.py
index d62829e..55f1383 100644
--- a/giscanner/codegen.py
+++ b/giscanner/codegen.py
@@ -52,7 +52,7 @@ class CCodeGenerator(object):
%s (""" % (self._typecontainer_to_ctype(func.retval), func.symbol))
l = len(func.parameters)
if func.parameters:
- for i,param in enumerate(func.parameters):
+ for i, param in enumerate(func.parameters):
ctype = self._typecontainer_to_ctype(param)
out.write('%s %s' % (ctype, param.argname))
if i < l - 1:
@@ -72,12 +72,14 @@ class CCodeGenerator(object):
self.out_c.write("/**\n * %s:\n" % (func.symbol, ))
for param in func.parameters:
self.out_c.write(" * @%s: " % (param.argname, ))
- if param.direction in (PARAM_DIRECTION_OUT, PARAM_DIRECTION_INOUT):
+ if param.direction in (PARAM_DIRECTION_OUT,
+ PARAM_DIRECTION_INOUT):
if param.caller_allocates:
allocate_string = ' caller-allocates'
else:
allocate_string = ''
- self.out_c.write("(%s%s) " % (param.direction, allocate_string))
+ self.out_c.write("(%s%s) " % (param.direction,
+ allocate_string))
self._write_annotation_transfer(param.transfer)
self.out_c.write(":\n")
self.out_c.write(' *\n')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]