##// END OF EJS Templates
Make default argv for testing instances....
Fernando Perez -
Show More
@@ -59,6 +59,19 b' log = logging.getLogger(__name__)'
59 # machinery into a fit. This code should be considered a gross hack, but it
59 # machinery into a fit. This code should be considered a gross hack, but it
60 # gets the job done.
60 # gets the job done.
61
61
62 def default_argv():
63 """Return a valid default argv for creating testing instances of ipython"""
64
65 # Get the install directory for the user configuration and tell ipython to
66 # use the default profile from there.
67 from IPython import UserConfig
68 ipcdir = os.path.dirname(UserConfig.__file__)
69 #ipconf = os.path.join(ipcdir,'ipy_user_conf.py')
70 ipconf = os.path.join(ipcdir,'ipythonrc')
71 #print 'conf:',ipconf # dbg
72
73 return ['--colors=NoColor','--noterm_title','-rcfile=%s' % ipconf]
74
62
75
63 # Hack to modify the %run command so we can sync the user's namespace with the
76 # Hack to modify the %run command so we can sync the user's namespace with the
64 # test globals. Once we move over to a clean magic system, this will be done
77 # test globals. Once we move over to a clean magic system, this will be done
@@ -148,10 +161,11 b' def start_ipython():'
148 _excepthook = sys.excepthook
161 _excepthook = sys.excepthook
149 _main = sys.modules.get('__main__')
162 _main = sys.modules.get('__main__')
150
163
164 argv = default_argv()
165
151 # Start IPython instance. We customize it to start with minimal frills.
166 # Start IPython instance. We customize it to start with minimal frills.
152 user_ns,global_ns = IPython.ipapi.make_user_namespaces(ipnsdict(),dict())
167 user_ns,global_ns = IPython.ipapi.make_user_namespaces(ipnsdict(),dict())
153 IPython.Shell.IPShell(['--colors=NoColor','--noterm_title'],
168 IPython.Shell.IPShell(argv,user_ns,global_ns)
154 user_ns,global_ns)
155
169
156 # Deactivate the various python system hooks added by ipython for
170 # Deactivate the various python system hooks added by ipython for
157 # interactive convenience so we don't confuse the doctest system
171 # interactive convenience so we don't confuse the doctest system
General Comments 0
You need to be logged in to leave comments. Login now