##// END OF EJS Templates
Fix wildcard search for new namespace model....
Thomas Kluyver -
Show More
@@ -923,7 +923,7 b' class InteractiveShell(SingletonConfigurable, Magic):'
923 # A table holding all the namespaces IPython deals with, so that
923 # A table holding all the namespaces IPython deals with, so that
924 # introspection facilities can search easily.
924 # introspection facilities can search easily.
925 self.ns_table = {'user_global':self.user_module.__dict__,
925 self.ns_table = {'user_global':self.user_module.__dict__,
926 'user_local':user_ns,
926 'user_local':self.user_ns,
927 'builtin':builtin_mod.__dict__
927 'builtin':builtin_mod.__dict__
928 }
928 }
929
929
@@ -693,7 +693,7 b' Currently the magic system has the following functions:\\n"""'
693 return
693 return
694
694
695 # default namespaces to be searched
695 # default namespaces to be searched
696 def_search = ['user','builtin']
696 def_search = ['user_local', 'user_global', 'builtin']
697
697
698 # Process options/args
698 # Process options/args
699 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
699 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
@@ -762,13 +762,15 b' class Inspector:'
762 (name,ns_table.keys()))
762 (name,ns_table.keys()))
763
763
764 #print 'type_pattern:',type_pattern # dbg
764 #print 'type_pattern:',type_pattern # dbg
765 search_result = []
765 search_result, namespaces_seen = set(), set()
766 for ns_name in ns_search:
766 for ns_name in ns_search:
767 ns = ns_table[ns_name]
767 ns = ns_table[ns_name]
768 tmp_res = list(list_namespace(ns,type_pattern,filter,
768 # Normally, locals and globals are the same, so we just check one.
769 ignore_case=ignore_case,
769 if id(ns) in namespaces_seen:
770 show_all=show_all))
770 continue
771 search_result.extend(tmp_res)
771 namespaces_seen.add(id(ns))
772 search_result.sort()
772 tmp_res = list_namespace(ns, type_pattern, filter,
773
773 ignore_case=ignore_case, show_all=show_all)
774 page.page('\n'.join(search_result))
774 search_result.update(tmp_res)
775
776 page.page('\n'.join(sorted(search_result)))
General Comments 0
You need to be logged in to leave comments. Login now