1
0
forked from VimPlug/jedi

Remove NamePart from existance and rename it to Name.

This commit is contained in:
Dave Halter
2014-09-26 16:29:53 +02:00
parent 522c9eda90
commit 03e01631cc
14 changed files with 36 additions and 37 deletions

View File

@@ -199,7 +199,7 @@ class ImportWrapper(pr.Base):
if star_imports:
scopes = [StarImportModule(scopes[0], star_imports)]
# goto only accepts Names or NameParts
# goto only accepts `Name`
if is_goto and not rest:
scopes = [s.name for s in scopes]
@@ -332,7 +332,7 @@ class _Importer(object):
self.file_path = os.path.dirname(path) if path is not None else None
def str_import_path(self):
"""Returns the import path as pure strings instead of NameParts."""
"""Returns the import path as pure strings instead of `Name`."""
return tuple(str(name_part) for name_part in self.import_path)
def get_relative_path(self):
@@ -374,12 +374,12 @@ class _Importer(object):
pos = (part._line, part._column)
try:
self.import_path = (
pr.NamePart(FakeSubModule, 'flask_' + str(part), part.parent, pos),
pr.Name(FakeSubModule, 'flask_' + str(part), part.parent, pos),
) + orig_path[3:]
return self._real_follow_file_system()
except ModuleNotFound as e:
self.import_path = (
pr.NamePart(FakeSubModule, 'flaskext', part.parent, pos),
pr.Name(FakeSubModule, 'flaskext', part.parent, pos),
) + orig_path[2:]
return self._real_follow_file_system()
return self._real_follow_file_system()