[gobject-introspection] giscanner: remove unused variables



commit bdb479f3663d284e1a785f603f17670a754d0bbf
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Fri Jun 29 14:43:33 2012 +0200

    giscanner: remove unused variables
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688897

 giscanner/annotationparser.py |   14 +-------------
 giscanner/maintransformer.py  |    9 ++++-----
 giscanner/scannermain.py      |    1 -
 giscanner/transformer.py      |    3 +--
 giscanner/utils.py            |    2 +-
 5 files changed, 7 insertions(+), 22 deletions(-)
---
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 89c4413..364fdbf 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -644,24 +644,17 @@ class AnnotationParser(object):
             # Check for GTK-Doc comment block identifier.
             ####################################################################
             if not comment_block:
-                # The correct identifier name would have the colon at the end
-                # but maintransformer.py does not expect us to do that. So
-                # make sure to compute an identifier_name without the colon and
-                # a real_identifier_name with the colon.
-
                 if not identifier:
                     result = SECTION_RE.search(line)
                     if result:
                         identifier = IDENTIFIER_SECTION
-                        real_identifier_name = 'SECTION:%s' % (result.group('section_name'))
-                        identifier_name = real_identifier_name
+                        identifier_name = 'SECTION:%s' % (result.group('section_name'))
                         column = result.start('section_name') + column_offset
 
                 if not identifier:
                     result = SYMBOL_RE.search(line)
                     if result:
                         identifier = IDENTIFIER_SYMBOL
-                        real_identifier_name = '%s:' % (result.group('symbol_name'))
                         identifier_name = '%s' % (result.group('symbol_name'))
                         column = result.start('symbol_name') + column_offset
 
@@ -669,8 +662,6 @@ class AnnotationParser(object):
                     result = PROPERTY_RE.search(line)
                     if result:
                         identifier = IDENTIFIER_PROPERTY
-                        real_identifier_name = '%s:%s:' % (result.group('class_name'),
-                                                           result.group('property_name'))
                         identifier_name = '%s:%s' % (result.group('class_name'),
                                                      result.group('property_name'))
                         column = result.start('property_name') + column_offset
@@ -679,8 +670,6 @@ class AnnotationParser(object):
                     result = SIGNAL_RE.search(line)
                     if result:
                         identifier = IDENTIFIER_SIGNAL
-                        real_identifier_name = '%s::%s:' % (result.group('class_name'),
-                                                            result.group('signal_name'))
                         identifier_name = '%s::%s' % (result.group('class_name'),
                                                       result.group('signal_name'))
                         column = result.start('signal_name') + column_offset
@@ -914,7 +903,6 @@ class AnnotationParser(object):
 
         result = MULTILINE_ANNOTATION_CONTINUATION_RE.search(line)
         if result:
-            line = result.group('description')
             column = result.start('annotations') + column_offset
             marker = ' '*column + '^'
             message.warn('ignoring invalid multiline annotation continuation:\n'
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 4ad800d..34d153b 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -125,7 +125,7 @@ usage is void (*_gtk_reserved1)(void);"""
     def _get_validate_parameter_name(self, parent, param_name, origin):
         try:
             param = parent.get_parameter(param_name)
-        except ValueError, e:
+        except ValueError:
             param = None
         if param is None:
             if isinstance(origin, ast.Parameter):
@@ -888,11 +888,10 @@ the ones that failed to resolve removed."""
                 else:
                     self._transformer.resolve_type(field.type)
         if isinstance(node, (ast.Class, ast.Interface)):
-            resolved_parent = None
             for parent in node.parent_chain:
                 try:
                     self._transformer.resolve_type(parent)
-                except ValueError, e:
+                except ValueError:
                     continue
                 target = self._transformer.lookup_typenode(parent)
                 if target:
@@ -1293,7 +1292,7 @@ method or constructor of some type."""
         params = node.parameters
 
         # First, do defaults for well-known callback types
-        for i, param in enumerate(params):
+        for param in params:
             argnode = self._transformer.lookup_typenode(param.type)
             if isinstance(argnode, ast.Callback):
                 if param.type.target_giname in ('Gio.AsyncReadyCallback',
@@ -1302,7 +1301,7 @@ method or constructor of some type."""
                     param.transfer = ast.PARAM_TRANSFER_NONE
 
         callback_param = None
-        for i, param in enumerate(params):
+        for param in params:
             argnode = self._transformer.lookup_typenode(param.type)
             is_destroynotify = False
             if isinstance(argnode, ast.Callback):
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index 45dcbcb..56d73f8 100755
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -310,7 +310,6 @@ def create_transformer(namespace, options):
         transformer.disable_cache()
         transformer.set_passthrough_mode()
 
-    shown_include_warning = False
     for include in options.includes:
         if os.sep in include:
             _error("Invalid include path %r" % (include, ))
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index e4938b9..6736799 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -903,9 +903,8 @@ Note that type resolution may not succeed."""
         pointer_stripped = typeval.ctype.replace('*', '')
         try:
             matches = self.split_ctype_namespaces(pointer_stripped)
-        except ValueError, e:
+        except ValueError:
             return self._resolve_type_from_ctype_all_namespaces(typeval, pointer_stripped)
-        target_giname = None
         for namespace, name in matches:
             target = namespace.get(name)
             if not target:
diff --git a/giscanner/utils.py b/giscanner/utils.py
index 642da36..9adf6d9 100644
--- a/giscanner/utils.py
+++ b/giscanner/utils.py
@@ -121,7 +121,7 @@ def get_libtool_command(options):
     try:
         subprocess.check_call(['libtool', '--version'],
                               stdout=open(os.devnull))
-    except (subprocess.CalledProcessError, OSError), e:
+    except (subprocess.CalledProcessError, OSError):
         # If libtool's not installed, assume we don't need it
         return None
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]