also enable autocompletion on namespace packages, fixes #122

This commit is contained in:
David Halter
2013-08-14 00:17:40 +04:30
parent 2e0863e76a
commit f5f1fcb8c3
2 changed files with 9 additions and 5 deletions

View File

@@ -129,7 +129,8 @@ class ImportPath(pr.Base):
if on_import_stmt and isinstance(scope, pr.Module) \
and scope.path.endswith('__init__.py'):
pkg_path = os.path.dirname(scope.path)
names += self.get_module_names([pkg_path])
paths = self._namespace_packages(pkg_path, self.import_path)
names += self.get_module_names([pkg_path] + paths)
for s, scope_names in evaluate.get_names_of_scope(scope,
include_builtin=False):
for n in scope_names: