summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2015-04-21 21:53:07 +0200
committerDieter Verfaillie <dieterv@optionexplicit.be>2015-06-29 16:59:36 +0200
commit2896dc4083accd92c4b80ef4d9972c2e2009bda2 (patch)
treeb1c5387735174df1248d59738fdd664d342a4bf7 /giscanner
parentdea692d32ce1e5ce2f1fff27d322d34cd7841747 (diff)
downloadgobject-introspection-2896dc4083accd92c4b80ef4d9972c2e2009bda2.tar.gz
tests: Update misc/pep8.py to 1.6.2
Updated from: https://raw.githubusercontent.com/jcrocholl/pep8/1.6.2/pep8.py
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/ast.py12
-rw-r--r--giscanner/gdumpparser.py4
-rw-r--r--giscanner/introspectablepass.py2
-rw-r--r--giscanner/maintransformer.py8
-rw-r--r--giscanner/message.py2
-rw-r--r--giscanner/sourcescanner.py2
-rw-r--r--giscanner/transformer.py4
7 files changed, 14 insertions, 20 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index fe3c5672..c7ea2d74 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -172,13 +172,10 @@ class TypeUnknown(Type):
def __init__(self):
Type.__init__(self, _target_unknown=True)
-######
-## Fundamental types
-######
-# Two special ones
+# Fundamental types, two special ones
TYPE_NONE = Type(target_fundamental='none', ctype='void')
TYPE_ANY = Type(target_fundamental='gpointer', ctype='gpointer')
-# "Basic" types
+# Fundamental types, "Basic" types
TYPE_BOOLEAN = Type(target_fundamental='gboolean', ctype='gboolean')
TYPE_INT8 = Type(target_fundamental='gint8', ctype='gint8')
TYPE_UINT8 = Type(target_fundamental='guint8', ctype='guint8')
@@ -328,10 +325,7 @@ type_names['ssize_t'] = TYPE_LONG
# Obj-C
type_names['id'] = TYPE_ANY
-##
-## Parameters
-##
-
+# Parameters
PARAM_DIRECTION_IN = 'in'
PARAM_DIRECTION_OUT = 'out'
PARAM_DIRECTION_INOUT = 'inout'
diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index e1fc9358..b49ceef1 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -203,7 +203,7 @@ blob containing data gleaned from GObject's primitive introspection."""
def _initparse_gobject_record(self, record):
if (record.name.startswith('ParamSpec')
- and not record.name in ('ParamSpecPool', 'ParamSpecClass', 'ParamSpecTypeInfo')):
+ and record.name not in ('ParamSpecPool', 'ParamSpecClass', 'ParamSpecTypeInfo')):
parent = None
if record.name != 'ParamSpec':
parent = ast.Type(target_giname='GObject.ParamSpec')
@@ -359,7 +359,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
else:
self._namespace.append(node, replace=True)
- ## WORKAROUND ##
+ # WORKAROUND
# https://bugzilla.gnome.org/show_bug.cgi?id=550616
def _introspect_boxed_gstreamer_workaround(self, xmlnode):
node = ast.Boxed('ParamSpecMiniObject', gtype_name='GParamSpecMiniObject',
diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py
index 3d67c73e..ac68b9f7 100644
--- a/giscanner/introspectablepass.py
+++ b/giscanner/introspectablepass.py
@@ -96,7 +96,7 @@ class IntrospectablePass(object):
if (is_parameter
and isinstance(target, ast.Callback)
- and not node.type.target_giname in ('GLib.DestroyNotify', 'Gio.AsyncReadyCallback')
+ and node.type.target_giname not in ('GLib.DestroyNotify', 'Gio.AsyncReadyCallback')
and node.scope is None):
self._parameter_warning(
parent,
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index df598adf..b138a121 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -349,7 +349,7 @@ class MainTransformer(object):
# (except enums and flags) or basic types that are
# as big as a gpointer
if array_type == ast.Array.GLIB_PTRARRAY:
- if ((element_type in ast.BASIC_GIR_TYPES and not element_type in ast.POINTER_TYPES)
+ if ((element_type in ast.BASIC_GIR_TYPES and element_type not in ast.POINTER_TYPES)
or isinstance(element_type, (ast.Enum, ast.Bitfield))):
message.warn("invalid (element-type) for a GPtrArray, "
"must be a pointer", annotations.position)
@@ -358,7 +358,7 @@ class MainTransformer(object):
if array_type == ast.Array.GLIB_BYTEARRAY:
if element_type == ast.TYPE_ANY:
array.element_type = ast.TYPE_UINT8
- elif not element_type in [ast.TYPE_UINT8, ast.TYPE_INT8, ast.TYPE_CHAR]:
+ elif element_type not in [ast.TYPE_UINT8, ast.TYPE_INT8, ast.TYPE_CHAR]:
message.warn("invalid (element-type) for a GByteArray, "
"must be one of guint8, gint8 or gchar",
annotations.position)
@@ -1250,8 +1250,8 @@ method or constructor of some type."""
"""Look for virtual methods from the class structure."""
if not node.glib_type_struct:
# https://bugzilla.gnome.org/show_bug.cgi?id=629080
- #message.warn_node(node,
- # "Failed to find class structure for %r" % (node.name, ))
+ # message.warn_node(node,
+ # "Failed to find class structure for %r" % (node.name, ))
return
node_type = node.create_type()
diff --git a/giscanner/message.py b/giscanner/message.py
index 34f23f94..6392dfc2 100644
--- a/giscanner/message.py
+++ b/giscanner/message.py
@@ -103,7 +103,7 @@ class MessageLogger(object):
self._warning_count += 1
- if not log_type in self._enable_warnings:
+ if log_type not in self._enable_warnings:
return
if type(positions) == set:
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py
index 9a814213..15ced3f5 100644
--- a/giscanner/sourcescanner.py
+++ b/giscanner/sourcescanner.py
@@ -236,7 +236,7 @@ class SourceScanner(object):
('-U', undefines)]:
for arg in (args or []):
opt = prefix + arg
- if not opt in self._cpp_options:
+ if opt not in self._cpp_options:
self._cpp_options.append(opt)
def parse_files(self, filenames):
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index db8e5a04..7acca226 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -96,7 +96,7 @@ class Transformer(object):
def parse(self, symbols):
for symbol in symbols:
- ## WORKAROUND ##
+ # WORKAROUND
# https://bugzilla.gnome.org/show_bug.cgi?id=550616
if symbol.ident in ['gst_g_error_get_type']:
continue
@@ -159,7 +159,7 @@ namespaces."""
if ns == self._namespace.name:
return self._namespace.get(giname)
# Fallback to the main namespace if not a dependency and matches a prefix
- if ns in self._namespace.identifier_prefixes and not ns in self._parsed_includes:
+ if ns in self._namespace.identifier_prefixes and ns not in self._parsed_includes:
message.warn(("Deprecated reference to identifier " +
"prefix %s in GIName %s") % (ns, name))
return self._namespace.get(giname)