espeed / bulbs

A Python persistence framework for graph databases like Neo4j, OrientDB and Titan.
http://bulbflow.org
Other
623 stars 82 forks source link

Groovy file fails to load when method signature spans multiple lines #111

Open bcajes opened 11 years ago

bcajes commented 11 years ago

g.scripts.update will fail with the following groovy example:

def foo(param1, param2)

it will work as expected with:

def foo(param1, param2)

Looks like the regex in bulbs/groovy.py may not handle this edge case:

File "/home/deploy/venvs/cpython27/lib/python2.7/site-packages/bulbs/groovy.py", line 192, in add_method method_signature = self._get_method_signature(method_definition) File "/home/deploy/venvs/cpython27/lib/python2.7/site-packages/bulbs/groovy.py", line 206, in _get_method_signature return re.search(pattern,method_definition).group(1).strip() AttributeError: 'NoneType' object has no attribute 'group'