diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-03-25 16:04:16 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-03-25 16:04:16 -0400 |
commit | 22fb044c3cb177aa197af1877c1c67e3f70066b7 (patch) | |
tree | 11cfb88f09a0ef722dac4e60feb36dedb358cccd /mako/_ast_util.py | |
parent | 6e78429b202362a9ed99decdf79bde978ce354de (diff) | |
download | external_python_mako-22fb044c3cb177aa197af1877c1c67e3f70066b7.tar.gz external_python_mako-22fb044c3cb177aa197af1877c1c67e3f70066b7.tar.bz2 external_python_mako-22fb044c3cb177aa197af1877c1c67e3f70066b7.zip |
- get flake8 to pass fully for mako/ (tests are a much bigger deal)
Diffstat (limited to 'mako/_ast_util.py')
-rw-r--r-- | mako/_ast_util.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mako/_ast_util.py b/mako/_ast_util.py index efbc4fc..604b090 100644 --- a/mako/_ast_util.py +++ b/mako/_ast_util.py @@ -30,7 +30,7 @@ :copyright: Copyright 2008 by Armin Ronacher. :license: Python License. """ -from _ast import * +from _ast import * # noqa from mako.compat import arg_stringname BOOLOP_SYMBOLS = { @@ -246,6 +246,7 @@ def walk(node): class NodeVisitor(object): + """ Walks the abstract syntax tree and call visitor functions for every node found. The visitor functions may return values which will be forwarded @@ -290,6 +291,7 @@ class NodeVisitor(object): class NodeTransformer(NodeVisitor): + """ Walks the abstract syntax tree and allows modifications of nodes. @@ -349,6 +351,7 @@ class NodeTransformer(NodeVisitor): class SourceGenerator(NodeVisitor): + """ This visitor is able to transform a well formed syntax tree into python sourcecode. For more details have a look at the docstring of the @@ -388,6 +391,7 @@ class SourceGenerator(NodeVisitor): def signature(self, node): want_comma = [] + def write_comma(): if want_comma: self.write(', ') @@ -460,6 +464,7 @@ class SourceGenerator(NodeVisitor): def visit_ClassDef(self, node): have_args = [] + def paren_or_comma(): if have_args: self.write(', ') @@ -631,6 +636,7 @@ class SourceGenerator(NodeVisitor): def visit_Call(self, node): want_comma = [] + def write_comma(): if want_comma: self.write(', ') |