From a1cf284297d7c919ee9ddab7d93031d8bd48d9ff Mon Sep 17 00:00:00 2001 From: David Halter Date: Wed, 25 Apr 2012 00:07:05 +0200 Subject: [PATCH] formatting / pep8 --- evaluate.py | 6 +++++- parsing.py | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/evaluate.py b/evaluate.py index bf3261a5..98b169ab 100644 --- a/evaluate.py +++ b/evaluate.py @@ -5,7 +5,8 @@ follow_statement -> follow_call -> follow_paths -> follow_path `get_names_for_scope` and `get_scopes_for_name` are search functions TODO include super classes -TOOD nonlocal statement +TODO nonlocal statement +TODO doc """ from _compatibility import next @@ -523,6 +524,9 @@ def follow_import(_import): def remove_star_imports(scope): + """ + TODO doc + """ modules = strip_imports(i for i in scope.get_imports() if i.star) new = [] for m in modules: diff --git a/parsing.py b/parsing.py index c33d9893..5ef60063 100644 --- a/parsing.py +++ b/parsing.py @@ -431,6 +431,7 @@ class Flow(Scope): next.parent = self.parent return next + class ForFlow(Flow): """ Used for the for loop, because there are two statement parts. @@ -440,6 +441,7 @@ class ForFlow(Flow): set_stmt.used_vars) self.set_stmt = set_stmt + class Import(Simple): """ Stores the imports of any Scopes. @@ -705,6 +707,9 @@ class Param(Statement): class Call(object): + """ + TODO doc + """ NAME = object() NUMBER = object() STRING = object() @@ -853,6 +858,10 @@ class Array(Call): class NamePart(str): + """ + A string. Sometimes it is important to know if the string belongs to a name + or not. + """ pass @@ -1406,7 +1415,4 @@ class PyFuzzyParser(object): debug.warning('indentation error on line %s, ignoring it' % (self.line_nr)) self.gen = tokenize.generate_tokens(buf.readline) - #except: - # debug.dbg("parse error: %s, %s @ %s" % - # (sys.exc_info()[0], sys.exc_info()[1], self.parserline)) return self.top