cleaning / pep8

This commit is contained in:
David Halter
2012-05-19 12:14:32 +02:00
parent 21a5825e6e
commit 7ac17aa036
4 changed files with 17 additions and 16 deletions

View File

@@ -85,7 +85,7 @@ class Definition(object):
path = str(par.path)
try:
return path[path.rindex('/')+1:]
return path[path.rindex('/') + 1:]
except ValueError:
return path
@@ -107,6 +107,7 @@ class Definition(object):
def __repr__(self):
return "<%s %s>" % (self.__class__.__name__, self)
def get_completion_parts(path):
"""
Returns the parts for the completion
@@ -133,7 +134,8 @@ def complete(source, row, column, source_path):
:rtype: list
"""
try:
scopes, path, dot, like = prepare_goto(source, row, column, source_path, True)
scopes, path, dot, like = prepare_goto(source, row, column,
source_path, True)
except NotFoundError:
# normally this would be used like this: `NotFoundError as exc`, but
# this guarantues backwards compatibility with Python2.5.
@@ -190,7 +192,7 @@ def prepare_goto(source, row, column, source_path, is_like_search):
if is_like_search:
stmt.line_nr = row
else:
stmt.line_nr = row+1
stmt.line_nr = row + 1
stmt.indent = column
stmt.parent = scope
scopes = evaluate.follow_statement(stmt, scope=scope)
@@ -200,6 +202,7 @@ def prepare_goto(source, row, column, source_path, is_like_search):
else:
return scopes
def get_definitions(source, row, column, source_path):
"""
Returns the definitions of a the path under the cursor.