natural/java2python — pull request #32 by hobson (2014-04-22 05:15:13+00:00)
Title: gitignore .pyc; make vistory.py more robust to lack of node children

+ .gitignore *.pyc
+ .gitignore egg dir
+ robust to empty node lists and nodes without children

# To reproduce ERROR:

$ cd ~/src
$ git clone https://github.com/ggp-org/ggp-base.git
$ ~/src/ggp-base/src/org/ggp/base/util/gdl
$ j2py GdlUtils.java GdlUtils.py

# ERROR Traceback:

Traceback (most recent call last):
File "/home/hobs/.virtualenvs/ggpy/bin/j2py", line 259, in
sys.exit(runMain(configScript(sys.argv[1:])))
File "/home/hobs/.virtualenvs/ggpy/bin/j2py", line 57, in runMain
return runOneOrMany(options)
File "/home/hobs/.virtualenvs/ggpy/bin/j2py", line 83, in runOneOrMany
return runTransform(options)
File "/home/hobs/.virtualenvs/ggpy/bin/j2py", line 135, in runTransform
module.walk(tree)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 86, in walk
visitor.walk(child, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 86, in walk
visitor.walk(child, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 86, in walk
visitor.walk(child, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 86, in walk
visitor.walk(child, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 86, in walk
visitor.walk(child, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 83, in walk
visitor = self.accept(tree, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 43, in accept
return call(node, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 484, in acceptIf
nextBlock.walk(nextNode.children[1], memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 86, in walk
visitor.walk(child, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 83, in walk
visitor = self.accept(tree, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 43, in accept
return call(node, memo)
File "/home/hobs/.virtualenvs/ggpy/lib/python2.7/site-packages/java2python/compiler/visitor.py", line 443, in acceptFor
if not node.firstChildOfType(tokens.BLOCK_SCOPE).children:
AttributeError: 'NoneType' object has no attribute 'children'