Continued to shorten the code lines to max. 79 characters.

Wed, 09 Oct 2013 18:40:07 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 09 Oct 2013 18:40:07 +0200
changeset 2998
95581102e03e
parent 2997
7f0ef975da9e
child 2999
28c75409a78f

Continued to shorten the code lines to max. 79 characters.

UtilitiesPython2/Py2SyntaxChecker.py file | annotate | diff | comparison | revisions
UtilitiesPython2/Tabnanny.py file | annotate | diff | comparison | revisions
UtilitiesPython2/Tools.py file | annotate | diff | comparison | revisions
UtilitiesPython2/py2flakes/checker.py file | annotate | diff | comparison | revisions
--- a/UtilitiesPython2/Py2SyntaxChecker.py	Wed Oct 09 18:34:30 2013 +0200
+++ b/UtilitiesPython2/Py2SyntaxChecker.py	Wed Oct 09 18:40:07 2013 +0200
@@ -115,7 +115,8 @@
                 continue
             
             _fn, lineno, message = warning.getMessageData()
-            if "__IGNORE_WARNING__" not in extractLineFlags(lines[lineno - 1].strip()):
+            if "__IGNORE_WARNING__" not in \
+                    extractLineFlags(lines[lineno - 1].strip()):
                 strings.extend(["FLAKES_WARNING", _fn, lineno, message])
     except SyntaxError as err:
         if err.text.strip():
@@ -161,7 +162,8 @@
         
         if not syntaxerror and sys.argv[1] in ["-fi", "-fs"]:
             # do pyflakes check
-            warningLines = flakesCheck(filename, codestring, sys.argv[1] == "-fi")
+            warningLines = flakesCheck(
+                filename, codestring, sys.argv[1] == "-fi")
             for warningLine in warningLines:
                 print warningLine
     
--- a/UtilitiesPython2/Tabnanny.py	Wed Oct 09 18:34:30 2013 +0200
+++ b/UtilitiesPython2/Tabnanny.py	Wed Oct 09 18:40:07 2013 +0200
@@ -93,7 +93,8 @@
 
 def check(filename, codestring):
     """
-    Private function to check one Python source file for whitespace related problems.
+    Private function to check one Python source file for whitespace related
+    problems.
     
     @param filename source filename (string)
     @param codestring source code (string)
@@ -114,7 +115,8 @@
         return (True, filename, "1", "Token Error: %s" % unicode(msg))
     
     except IndentationError, err:
-        return (True, filename, err.lineno, "Indentation Error: %s" % unicode(err.msg))
+        return (True, filename, err.lineno,
+                "Indentation Error: %s" % unicode(err.msg))
     
     except NannyNag, nag:
         badline = nag.get_lineno()
@@ -224,7 +226,8 @@
     # for all t >= 1
     def equal(self, other):
         """
-        Method to compare the indentation levels of two Whitespace objects for equality.
+        Method to compare the indentation levels of two Whitespace objects for
+        equality.
         
         @param other Whitespace object to compare against.
         @return True, if we compare equal against the other Whitespace object.
@@ -271,8 +274,8 @@
     # Note that M is of the form (T*)(S*) iff len(M.norm[0]) <= 1.
     def less(self, other):
         """
-        Method to compare the indentation level against another Whitespace objects to
-        be smaller.
+        Method to compare the indentation level against another Whitespace
+        objects to be smaller.
         
         @param other Whitespace object to compare against.
         @return True, if we compare less against the other Whitespace object.
@@ -370,7 +373,8 @@
             # Ouch!  This assert triggers if the last line of the source
             # is indented *and* lacks a newline -- then DEDENTs pop out
             # of thin air.
-            # assert check_equal  # else no earlier NEWLINE, or an earlier INDENT
+            # assert check_equal  # else no earlier NEWLINE, or an
+            # earlier INDENT
             check_equal = 1
 
             del indents[-1]
--- a/UtilitiesPython2/Tools.py	Wed Oct 09 18:34:30 2013 +0200
+++ b/UtilitiesPython2/Tools.py	Wed Oct 09 18:40:07 2013 +0200
@@ -99,7 +99,8 @@
 
 def extractLineFlags(line, startComment="#", endComment=""):
     """
-    Function to extract flags starting and ending with '__' from a line comment.
+    Function to extract flags starting and ending with '__' from a line
+    comment.
     
     @param line line to extract flags from (string)
     @keyparam startComment string identifying the start of the comment (string)
--- a/UtilitiesPython2/py2flakes/checker.py	Wed Oct 09 18:34:30 2013 +0200
+++ b/UtilitiesPython2/py2flakes/checker.py	Wed Oct 09 18:40:07 2013 +0200
@@ -22,8 +22,8 @@
 except (ImportError, AttributeError):
     def iter_child_nodes(node, astcls=_ast.AST):
         """
-        Yield all direct child nodes of *node*, that is, all fields that are nodes
-        and all items of fields that are lists of nodes.
+        Yield all direct child nodes of *node*, that is, all fields that are
+        nodes and all items of fields that are lists of nodes.
         """
         for name in node._fields:
             field = getattr(node, name, None)
@@ -291,7 +291,8 @@
                 print '  ' * self.nodeDepth + node.__class__.__name__
             self.nodeDepth += 1
             if self.futuresAllowed and not \
-                   (isinstance(node, _ast.ImportFrom) or self.isDocstring(node)):
+                   (isinstance(node, _ast.ImportFrom) or 
+                    self.isDocstring(node)):
                 self.futuresAllowed = False
             nodeType = node.__class__.__name__.upper()
             try:
@@ -337,7 +338,8 @@
         '''
         Called when a binding is altered.
 
-        @param lineno line of the statement responsible for the change (integer)
+        @param lineno line of the statement responsible for the change
+            (integer)
         @param value the optional new value, a Binding instance, associated
             with the binding; if None, the binding is deleted if it exists
         @param reportRedef flag indicating if rebinding while unused will be
@@ -346,7 +348,8 @@
         if (isinstance(self.scope.get(value.name), FunctionDefinition)
                     and isinstance(value, FunctionDefinition)):
             self.report(messages.RedefinedFunction,
-                        lineno, value.name, self.scope[value.name].source.lineno)
+                        lineno, value.name,
+                        self.scope[value.name].source.lineno)
 
         if not isinstance(self.scope, ClassScope):
             for scope in self.scopeStack[::-1]:
@@ -358,7 +361,8 @@
                     and reportRedef):
 
                     self.report(messages.RedefinedWhileUnused,
-                                lineno, value.name, scope[value.name].source.lineno)
+                                lineno, value.name,
+                                scope[value.name].source.lineno)
 
         if isinstance(value, UnBinding):
             try:
@@ -456,10 +460,12 @@
                         # the special name __path__ is valid only in packages
                         pass
                     else:
-                        self.report(messages.UndefinedName, node.lineno, node.id)
+                        self.report(messages.UndefinedName,
+                                    node.lineno, node.id)
         elif isinstance(node.ctx, (_ast.Store, _ast.AugStore)):
             # if the name hasn't already been defined in the current scope
-            if isinstance(self.scope, FunctionScope) and node.id not in self.scope:
+            if isinstance(self.scope, FunctionScope) and \
+                    node.id not in self.scope:
                 # for each function or module scope above us
                 for scope in self.scopeStack[:-1]:
                     if not isinstance(scope, (FunctionScope, ModuleScope)):
@@ -479,7 +485,8 @@
                         break
 
             if isinstance(node.parent,
-                          (_ast.For, _ast.comprehension, _ast.Tuple, _ast.List)):
+                          (_ast.For, _ast.comprehension, _ast.Tuple,
+                           _ast.List)):
                 binding = Binding(node.id, node)
             elif (node.id == '__all__' and
                   isinstance(self.scope, ModuleScope)):
@@ -496,8 +503,8 @@
             else:
                 self.addBinding(node.lineno, UnBinding(node.id, node))
         else:
-            # must be a Param context -- this only happens for names in function
-            # arguments, but these aren't dispatched through here
+            # must be a Param context -- this only happens for names in
+            # function arguments, but these aren't dispatched through here
             raise RuntimeError(
                 "Got impossible expression context: %r" % (node.ctx,))
 
@@ -524,7 +531,8 @@
                         addArgs(arg.elts)
                     else:
                         if arg.id in args:
-                            self.report(messages.DuplicateArgument, node.lineno, arg.id)
+                            self.report(messages.DuplicateArgument,
+                                        node.lineno, arg.id)
                         args.append(arg.id)
 
             self.pushFunctionScope()
@@ -535,7 +543,8 @@
             if node.args.kwarg:
                 args.append(node.args.kwarg)
             for name in args:
-                self.addBinding(node.lineno, Argument(name, node), reportRedef=False)
+                self.addBinding(node.lineno, Argument(name, node),
+                                reportRedef=False)
             if isinstance(node.body, list):
                 # case for FunctionDefs
                 for stmt in node.body:
@@ -581,8 +590,8 @@
             self.handleNode(target, node)
 
     def AUGASSIGN(self, node):
-        # AugAssign is awkward: must set the context explicitly and visit twice,
-        # once with AugLoad context, once with AugStore context
+        # AugAssign is awkward: must set the context explicitly and visit
+        # twice, once with AugLoad context, once with AugStore context
         node.target.ctx = _ast.AugLoad()
         self.handleNode(node.target, node)
         self.handleNode(node.value, node)

eric ide

mercurial