##// END OF EJS Templates
import completer: do not so too deeply nested packages before we get deeper
vivainio -
Show More
@@ -57,8 +57,12 b' def module_completer(self,event):'
57 print "\n\n[Standby while scanning modules, this can take a while]\n\n"
57 print "\n\n[Standby while scanning modules, this can take a while]\n\n"
58 pkg_cache = list(pkgutil.walk_packages())
58 pkg_cache = list(pkgutil.walk_packages())
59
59
60 already = set()
60 for ld, name, ispkg in pkg_cache:
61 for ld, name, ispkg in pkg_cache:
61 yield name
62 if name.count('.') < event.symbol.count('.') + 1:
63 if name not in already:
64 already.add(name)
65 yield name + (ispkg and '.' or '')
62 return
66 return
63
67
64 ip.set_hook('complete_command', module_completer, str_key = 'import')
68 ip.set_hook('complete_command', module_completer, str_key = 'import')
General Comments 0
You need to be logged in to leave comments. Login now