From 20b1243b013c743bfd5d0d520cec43677d28b337 2015-10-08 13:26:50 From: Min RK Date: 2015-10-08 13:26:50 Subject: [PATCH] use module completion on %aimport --- diff --git a/IPython/core/completerlib.py b/IPython/core/completerlib.py index f76ea85..57dd2b5 100644 --- a/IPython/core/completerlib.py +++ b/IPython/core/completerlib.py @@ -223,7 +223,7 @@ def module_completion(line): return ['import '] # 'from xy' or 'import xy' - if nwords < 3 and (words[0] in ['import','from']) : + if nwords < 3 and (words[0] in {'%aimport', 'import', 'from'}) : if nwords == 1: return get_root_modules() mod = words[1].split('.') diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 3dbb7ad..aa2d55f 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2103,6 +2103,7 @@ class InteractiveShell(SingletonConfigurable): self.set_hook('complete_command', module_completer, str_key = 'import') self.set_hook('complete_command', module_completer, str_key = 'from') + self.set_hook('complete_command', module_completer, str_key = '%aimport') self.set_hook('complete_command', magic_run_completer, str_key = '%run') self.set_hook('complete_command', cd_completer, str_key = '%cd') self.set_hook('complete_command', reset_completer, str_key = '%reset')