mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
cleaning / pep8
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user