1
0
forked from VimPlug/jedi

move BaseDefinition.path to _path

This commit is contained in:
David Halter
2013-08-22 12:35:08 +04:30
parent 2f3304b9f1
commit cce425cb6d

View File

@@ -148,8 +148,7 @@ class BaseDefinition(object):
stripped = stripped.parent stripped = stripped.parent
return type(stripped).__name__.lower() return type(stripped).__name__.lower()
@property def _path(self):
def path(self):
"""The module path.""" """The module path."""
path = [] path = []
@@ -285,7 +284,7 @@ class BaseDefinition(object):
(for example) ``'posixpath.join'``. (for example) ``'posixpath.join'``.
""" """
path = [unicode(p) for p in self.path] path = [unicode(p) for p in self._path()]
# TODO add further checks, the mapping should only occur on stdlib. # TODO add further checks, the mapping should only occur on stdlib.
if not path: if not path:
return None # for keywords the path is empty return None # for keywords the path is empty
@@ -395,7 +394,7 @@ class Completion(BaseDefinition):
if t == 'statement' or t == 'import': if t == 'statement' or t == 'import':
desc = self._definition.get_code(False) desc = self._definition.get_code(False)
else: else:
desc = '.'.join(unicode(p) for p in self.path) desc = '.'.join(unicode(p) for p in self._path())
line = '' if self.in_builtin_module else '@%s' % self.line line = '' if self.in_builtin_module else '@%s' % self.line
return '%s: %s%s' % (t, desc, line) return '%s: %s%s' % (t, desc, line)