1
0
forked from VimPlug/jedi

deprecated BaseDefinition.line_nr in favor of 'line'. thx @dbrgn for the hint.

This commit is contained in:
David Halter
2012-12-27 18:12:18 +01:00
parent db4b09e05e
commit 22fcfe5e19

View File

@@ -91,6 +91,14 @@ class BaseDefinition(object):
@property @property
def line_nr(self): def line_nr(self):
""" Use line instead!
TODO remove, deprecated! it's just here for backwards compatibility
"""
raise DeprecationWarning("Use line instead.")
return self.line
@property
def line(self):
""" The line where the definition occurs (starting with 1). """ """ The line where the definition occurs (starting with 1). """
return self.start_pos[0] return self.start_pos[0]
@@ -204,8 +212,8 @@ class Completion(BaseDefinition):
else: else:
desc = '.'.join(unicode(p) for p in self.path) desc = '.'.join(unicode(p) for p in self.path)
line_nr = '' if self.in_builtin_module else '@%s' % self.line_nr line = '' if self.in_builtin_module else '@%s' % self.line
return '%s: %s%s' % (t, desc, line_nr) return '%s: %s%s' % (t, desc, line)
def follow_definition(self): def follow_definition(self):
""" """
@@ -282,7 +290,7 @@ class Definition(BaseDefinition):
""" """
if self.module_path.endswith('.py') \ if self.module_path.endswith('.py') \
and not isinstance(self.definition, parsing.Module): and not isinstance(self.definition, parsing.Module):
position = '@%s' % (self.line_nr) position = '@%s' % (self.line)
else: else:
# is a builtin or module # is a builtin or module
position = '' position = ''