##// END OF EJS Templates
update release/authors...
MinRK -
Show More
@@ -1,87 +1,85 b''
1 1 # encoding: utf-8
2 2 """
3 3 IPython: tools for interactive and parallel computing in Python.
4 4
5 5 http://ipython.org
6 6 """
7 7 #-----------------------------------------------------------------------------
8 8 # Copyright (c) 2008-2011, IPython Development Team.
9 9 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10 10 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 11 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12 12 #
13 13 # Distributed under the terms of the Modified BSD License.
14 14 #
15 15 # The full license is in the file COPYING.txt, distributed with this software.
16 16 #-----------------------------------------------------------------------------
17 17
18 18 #-----------------------------------------------------------------------------
19 19 # Imports
20 20 #-----------------------------------------------------------------------------
21 21 from __future__ import absolute_import
22 22
23 23 import os
24 24 import sys
25 25
26 26 #-----------------------------------------------------------------------------
27 27 # Setup everything
28 28 #-----------------------------------------------------------------------------
29 29
30 30 # Don't forget to also update setup.py when this changes!
31 31 if sys.version[0:3] < '2.6':
32 32 raise ImportError('Python Version 2.6 or above is required for IPython.')
33 33
34 34 # Make it easy to import extensions - they are always directly on pythonpath.
35 35 # Therefore, non-IPython modules can be added to extensions directory.
36 36 # This should probably be in ipapp.py.
37 37 sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
38 38
39 39 #-----------------------------------------------------------------------------
40 40 # Setup the top level names
41 41 #-----------------------------------------------------------------------------
42 42
43 43 from .config.loader import Config
44 44 from .core import release
45 45 from .core.application import Application
46 46 from .frontend.terminal.embed import embed
47 47
48 48 from .core.error import TryNext
49 49 from .core.interactiveshell import InteractiveShell
50 50 from .testing import test
51 51 from .utils.sysinfo import sys_info
52 52 from .utils.frame import extract_module_locals
53 53
54 54 # Release data
55 __author__ = ''
56 for author, email in release.authors.itervalues():
57 __author__ += author + ' <' + email + '>\n'
55 __author__ = '%s <%s>' % (release.author, release.author_email)
58 56 __license__ = release.license
59 57 __version__ = release.version
60 58 version_info = release.version_info
61 59
62 60 def embed_kernel(module=None, local_ns=None, **kwargs):
63 61 """Embed and start an IPython kernel in a given scope.
64 62
65 63 Parameters
66 64 ----------
67 65 module : ModuleType, optional
68 66 The module to load into IPython globals (default: caller)
69 67 local_ns : dict, optional
70 68 The namespace to load into IPython user namespace (default: caller)
71 69
72 70 kwargs : various, optional
73 71 Further keyword args are relayed to the KernelApp constructor,
74 72 allowing configuration of the Kernel. Will only have an effect
75 73 on the first embed_kernel call for a given process.
76 74
77 75 """
78 76
79 77 (caller_module, caller_locals) = extract_module_locals(1)
80 78 if module is None:
81 79 module = caller_module
82 80 if local_ns is None:
83 81 local_ns = caller_locals
84 82
85 83 # Only import .zmq when we really need it
86 84 from .zmq.ipkernel import embed_kernel as real_embed_kernel
87 85 real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
@@ -1,151 +1,151 b''
1 1 # -*- coding: utf-8 -*-
2 2 """Release data for the IPython project."""
3 3
4 4 #-----------------------------------------------------------------------------
5 5 # Copyright (c) 2008, IPython Development Team.
6 6 # Copyright (c) 2001, Fernando Perez <fernando.perez@colorado.edu>
7 7 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
8 8 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
9 9 #
10 10 # Distributed under the terms of the Modified BSD License.
11 11 #
12 12 # The full license is in the file COPYING.txt, distributed with this software.
13 13 #-----------------------------------------------------------------------------
14 14
15 15 # Name of the package for release purposes. This is the name which labels
16 16 # the tarballs and RPMs made by distutils, so it's best to lowercase it.
17 17 name = 'ipython'
18 18
19 19 # IPython version information. An empty _version_extra corresponds to a full
20 20 # release. 'dev' as a _version_extra string means this is a development
21 21 # version
22 22 _version_major = 0
23 23 _version_minor = 14
24 24 _version_micro = 0 # use 0 for first of series, number for 1 and above
25 25 _version_extra = 'dev'
26 26 #_version_extra = 'rc1'
27 27 # _version_extra = '' # Uncomment this for full releases
28 28
29 29 # Construct full version string from these.
30 30 _ver = [_version_major, _version_minor]
31 31 if _version_micro:
32 32 _ver.append(_version_micro)
33 33 if _version_extra:
34 34 _ver.append(_version_extra)
35 35
36 36 __version__ = '.'.join(map(str, _ver))
37 37
38 38 version = __version__ # backwards compatibility name
39 39 version_info = (_version_major, _version_minor, _version_micro, _version_extra)
40 40
41 41 # Change this when incrementing the kernel protocol version
42 42 kernel_protocol_version_info = (4, 0)
43 43
44 44 description = "IPython: Productive Interactive Computing"
45 45
46 46 long_description = \
47 47 """
48 48 IPython provides a rich toolkit to help you make the most out of using Python
49 49 interactively. Its main components are:
50 50
51 51 * Powerful interactive Python shells (terminal- and Qt-based).
52 52 * A web-based interactive notebook environment with all shell features plus
53 53 support for embedded figures, animations and rich media.
54 54 * Support for interactive data visualization and use of GUI toolkits.
55 55 * Flexible, embeddable interpreters to load into your own projects.
56 56 * A high-performance library for high level and interactive parallel computing
57 57 that works in multicore systems, clusters, supercomputing and cloud scenarios.
58 58
59 59 The enhanced interactive Python shells have the following main features:
60 60
61 61 * Comprehensive object introspection.
62 62
63 63 * Input history, persistent across sessions.
64 64
65 65 * Caching of output results during a session with automatically generated
66 66 references.
67 67
68 68 * Extensible tab completion, with support by default for completion of python
69 69 variables and keywords, filenames and function keywords.
70 70
71 71 * Extensible system of 'magic' commands for controlling the environment and
72 72 performing many tasks related either to IPython or the operating system.
73 73
74 74 * A rich configuration system with easy switching between different setups
75 75 (simpler than changing $PYTHONSTARTUP environment variables every time).
76 76
77 77 * Session logging and reloading.
78 78
79 79 * Extensible syntax processing for special purpose situations.
80 80
81 81 * Access to the system shell with user-extensible alias system.
82 82
83 83 * Easily embeddable in other Python programs and GUIs.
84 84
85 85 * Integrated access to the pdb debugger and the Python profiler.
86 86
87 87 The parallel computing architecture has the following main features:
88 88
89 89 * Quickly parallelize Python code from an interactive Python/IPython session.
90 90
91 91 * A flexible and dynamic process model that be deployed on anything from
92 92 multicore workstations to supercomputers.
93 93
94 94 * An architecture that supports many different styles of parallelism, from
95 95 message passing to task farming.
96 96
97 97 * Both blocking and fully asynchronous interfaces.
98 98
99 99 * High level APIs that enable many things to be parallelized in a few lines
100 100 of code.
101 101
102 102 * Share live parallel jobs with other users securely.
103 103
104 104 * Dynamically load balanced task farming system.
105 105
106 106 * Robust error handling in parallel code.
107 107
108 108 The latest development version is always available from IPython's `GitHub
109 109 site <http://github.com/ipython>`_.
110 110 """
111 111
112 112 license = 'BSD'
113 113
114 114 authors = {'Fernando' : ('Fernando Perez','fperez.net@gmail.com'),
115 115 'Janko' : ('Janko Hauser','jhauser@zscout.de'),
116 116 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'),
117 117 'Ville' : ('Ville Vainio','vivainio@gmail.com'),
118 118 'Brian' : ('Brian E Granger', 'ellisonbg@gmail.com'),
119 119 'Min' : ('Min Ragan-Kelley', 'benjaminrk@gmail.com'),
120 120 'Thomas' : ('Thomas A. Kluyver', 'takowl@gmail.com'),
121 121 'Jorgen' : ('Jorgen Stenarson', 'jorgen.stenarson@bostream.nu'),
122 122 'Matthias' : ('Matthias Bussonnier', 'bussonniermatthias@gmail.com'),
123 123 }
124 124
125 125 author = 'The IPython Development Team'
126 126
127 127 author_email = 'ipython-dev@scipy.org'
128 128
129 129 url = 'http://ipython.org'
130 130
131 131 download_url = 'https://github.com/ipython/ipython/downloads'
132 132
133 platforms = ['Linux','Mac OSX','Windows XP/2000/NT/Vista/7']
133 platforms = ['Linux','Mac OSX','Windows XP/Vista/7/8']
134 134
135 135 keywords = ['Interactive','Interpreter','Shell','Parallel','Distributed',
136 136 'Web-based computing', 'Qt console', 'Embedding']
137 137
138 138 classifiers = [
139 139 'Intended Audience :: Developers',
140 140 'Intended Audience :: Science/Research',
141 141 'License :: OSI Approved :: BSD License',
142 142 'Programming Language :: Python',
143 143 'Programming Language :: Python :: 2',
144 144 'Programming Language :: Python :: 2.6',
145 145 'Programming Language :: Python :: 2.7',
146 146 'Programming Language :: Python :: 3',
147 'Programming Language :: Python :: 3.1',
148 147 'Programming Language :: Python :: 3.2',
148 'Programming Language :: Python :: 3.3',
149 149 'Topic :: System :: Distributed Computing',
150 150 'Topic :: System :: Shells'
151 151 ]
@@ -1,393 +1,393 b''
1 1 #!/usr/bin/env python
2 2 # encoding: utf-8
3 3 """
4 4 The :class:`~IPython.core.application.Application` object for the command
5 5 line :command:`ipython` program.
6 6
7 7 Authors
8 8 -------
9 9
10 10 * Brian Granger
11 11 * Fernando Perez
12 12 * Min Ragan-Kelley
13 13 """
14 14
15 15 #-----------------------------------------------------------------------------
16 16 # Copyright (C) 2008-2011 The IPython Development Team
17 17 #
18 18 # Distributed under the terms of the BSD License. The full license is in
19 19 # the file COPYING, distributed as part of this software.
20 20 #-----------------------------------------------------------------------------
21 21
22 22 #-----------------------------------------------------------------------------
23 23 # Imports
24 24 #-----------------------------------------------------------------------------
25 25
26 26 from __future__ import absolute_import
27 27
28 28 import logging
29 29 import os
30 30 import sys
31 31
32 32 from IPython.config.loader import (
33 33 Config, PyFileConfigLoader, ConfigFileNotFound
34 34 )
35 35 from IPython.config.application import boolean_flag, catch_config_error
36 36 from IPython.core import release
37 37 from IPython.core import usage
38 38 from IPython.core.completer import IPCompleter
39 39 from IPython.core.crashhandler import CrashHandler
40 40 from IPython.core.formatters import PlainTextFormatter
41 41 from IPython.core.history import HistoryManager
42 42 from IPython.core.prompts import PromptManager
43 43 from IPython.core.application import (
44 44 ProfileDir, BaseIPythonApplication, base_flags, base_aliases
45 45 )
46 46 from IPython.core.magics import ScriptMagics
47 47 from IPython.core.shellapp import (
48 48 InteractiveShellApp, shell_flags, shell_aliases
49 49 )
50 50 from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
51 51 from IPython.lib import inputhook
52 52 from IPython.utils import warn
53 53 from IPython.utils.path import get_ipython_dir, check_for_old_config
54 54 from IPython.utils.traitlets import (
55 55 Bool, List, Dict, CaselessStrEnum
56 56 )
57 57
58 58 #-----------------------------------------------------------------------------
59 59 # Globals, utilities and helpers
60 60 #-----------------------------------------------------------------------------
61 61
62 62 #: The default config file name for this application.
63 63 default_config_file_name = u'ipython_config.py'
64 64
65 65 _examples = """
66 66 ipython --pylab # start in pylab mode
67 67 ipython --pylab=qt # start in pylab mode with the qt4 backend
68 68 ipython --log-level=DEBUG # set logging to DEBUG
69 69 ipython --profile=foo # start with profile foo
70 70
71 71 ipython qtconsole # start the qtconsole GUI application
72 72 ipython help qtconsole # show the help for the qtconsole subcmd
73 73
74 74 ipython console # start the terminal-based console application
75 75 ipython help console # show the help for the console subcmd
76 76
77 77 ipython notebook # start the IPython notebook
78 78 ipython help notebook # show the help for the notebook subcmd
79 79
80 80 ipython profile create foo # create profile foo w/ default config files
81 81 ipython help profile # show the help for the profile subcmd
82 82
83 83 ipython locate # print the path to the IPython directory
84 84 ipython locate profile foo # print the path to the directory for profile `foo`
85 85 """
86 86
87 87 #-----------------------------------------------------------------------------
88 88 # Crash handler for this application
89 89 #-----------------------------------------------------------------------------
90 90
91 91 class IPAppCrashHandler(CrashHandler):
92 92 """sys.excepthook for IPython itself, leaves a detailed report on disk."""
93 93
94 94 def __init__(self, app):
95 contact_name = release.authors['Fernando'][0]
95 contact_name = release.author
96 96 contact_email = release.author_email
97 97 bug_tracker = 'https://github.com/ipython/ipython/issues'
98 98 super(IPAppCrashHandler,self).__init__(
99 99 app, contact_name, contact_email, bug_tracker
100 100 )
101 101
102 102 def make_report(self,traceback):
103 103 """Return a string containing a crash report."""
104 104
105 105 sec_sep = self.section_sep
106 106 # Start with parent report
107 107 report = [super(IPAppCrashHandler, self).make_report(traceback)]
108 108 # Add interactive-specific info we may have
109 109 rpt_add = report.append
110 110 try:
111 111 rpt_add(sec_sep+"History of session input:")
112 112 for line in self.app.shell.user_ns['_ih']:
113 113 rpt_add(line)
114 114 rpt_add('\n*** Last line of input (may not be in above history):\n')
115 115 rpt_add(self.app.shell._last_input_line+'\n')
116 116 except:
117 117 pass
118 118
119 119 return ''.join(report)
120 120
121 121 #-----------------------------------------------------------------------------
122 122 # Aliases and Flags
123 123 #-----------------------------------------------------------------------------
124 124 flags = dict(base_flags)
125 125 flags.update(shell_flags)
126 126 frontend_flags = {}
127 127 addflag = lambda *args: frontend_flags.update(boolean_flag(*args))
128 128 addflag('autoedit-syntax', 'TerminalInteractiveShell.autoedit_syntax',
129 129 'Turn on auto editing of files with syntax errors.',
130 130 'Turn off auto editing of files with syntax errors.'
131 131 )
132 132 addflag('banner', 'TerminalIPythonApp.display_banner',
133 133 "Display a banner upon starting IPython.",
134 134 "Don't display a banner upon starting IPython."
135 135 )
136 136 addflag('confirm-exit', 'TerminalInteractiveShell.confirm_exit',
137 137 """Set to confirm when you try to exit IPython with an EOF (Control-D
138 138 in Unix, Control-Z/Enter in Windows). By typing 'exit' or 'quit',
139 139 you can force a direct exit without any confirmation.""",
140 140 "Don't prompt the user when exiting."
141 141 )
142 142 addflag('term-title', 'TerminalInteractiveShell.term_title',
143 143 "Enable auto setting the terminal title.",
144 144 "Disable auto setting the terminal title."
145 145 )
146 146 classic_config = Config()
147 147 classic_config.InteractiveShell.cache_size = 0
148 148 classic_config.PlainTextFormatter.pprint = False
149 149 classic_config.PromptManager.in_template = '>>> '
150 150 classic_config.PromptManager.in2_template = '... '
151 151 classic_config.PromptManager.out_template = ''
152 152 classic_config.InteractiveShell.separate_in = ''
153 153 classic_config.InteractiveShell.separate_out = ''
154 154 classic_config.InteractiveShell.separate_out2 = ''
155 155 classic_config.InteractiveShell.colors = 'NoColor'
156 156 classic_config.InteractiveShell.xmode = 'Plain'
157 157
158 158 frontend_flags['classic']=(
159 159 classic_config,
160 160 "Gives IPython a similar feel to the classic Python prompt."
161 161 )
162 162 # # log doesn't make so much sense this way anymore
163 163 # paa('--log','-l',
164 164 # action='store_true', dest='InteractiveShell.logstart',
165 165 # help="Start logging to the default log file (./ipython_log.py).")
166 166 #
167 167 # # quick is harder to implement
168 168 frontend_flags['quick']=(
169 169 {'TerminalIPythonApp' : {'quick' : True}},
170 170 "Enable quick startup with no config files."
171 171 )
172 172
173 173 frontend_flags['i'] = (
174 174 {'TerminalIPythonApp' : {'force_interact' : True}},
175 175 """If running code from the command line, become interactive afterwards.
176 176 Note: can also be given simply as '-i.'"""
177 177 )
178 178 flags.update(frontend_flags)
179 179
180 180 aliases = dict(base_aliases)
181 181 aliases.update(shell_aliases)
182 182
183 183 #-----------------------------------------------------------------------------
184 184 # Main classes and functions
185 185 #-----------------------------------------------------------------------------
186 186
187 187
188 188 class LocateIPythonApp(BaseIPythonApplication):
189 189 description = """print the path to the IPython dir"""
190 190 subcommands = Dict(dict(
191 191 profile=('IPython.core.profileapp.ProfileLocate',
192 192 "print the path to an IPython profile directory",
193 193 ),
194 194 ))
195 195 def start(self):
196 196 if self.subapp is not None:
197 197 return self.subapp.start()
198 198 else:
199 199 print self.ipython_dir
200 200
201 201
202 202 class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):
203 203 name = u'ipython'
204 204 description = usage.cl_usage
205 205 default_config_file_name = default_config_file_name
206 206 crash_handler_class = IPAppCrashHandler
207 207 examples = _examples
208 208
209 209 flags = Dict(flags)
210 210 aliases = Dict(aliases)
211 211 classes = List()
212 212 def _classes_default(self):
213 213 """This has to be in a method, for TerminalIPythonApp to be available."""
214 214 return [
215 215 InteractiveShellApp, # ShellApp comes before TerminalApp, because
216 216 self.__class__, # it will also affect subclasses (e.g. QtConsole)
217 217 TerminalInteractiveShell,
218 218 PromptManager,
219 219 HistoryManager,
220 220 ProfileDir,
221 221 PlainTextFormatter,
222 222 IPCompleter,
223 223 ScriptMagics,
224 224 ]
225 225
226 226 subcommands = Dict(dict(
227 227 qtconsole=('IPython.frontend.qt.console.qtconsoleapp.IPythonQtConsoleApp',
228 228 """Launch the IPython Qt Console."""
229 229 ),
230 230 notebook=('IPython.frontend.html.notebook.notebookapp.NotebookApp',
231 231 """Launch the IPython HTML Notebook Server."""
232 232 ),
233 233 profile = ("IPython.core.profileapp.ProfileApp",
234 234 "Create and manage IPython profiles."
235 235 ),
236 236 kernel = ("IPython.zmq.ipkernel.IPKernelApp",
237 237 "Start a kernel without an attached frontend."
238 238 ),
239 239 console=('IPython.frontend.terminal.console.app.ZMQTerminalIPythonApp',
240 240 """Launch the IPython terminal-based Console."""
241 241 ),
242 242 locate=('IPython.frontend.terminal.ipapp.LocateIPythonApp',
243 243 LocateIPythonApp.description
244 244 ),
245 245 ))
246 246
247 247 # *do* autocreate requested profile, but don't create the config file.
248 248 auto_create=Bool(True)
249 249 # configurables
250 250 ignore_old_config=Bool(False, config=True,
251 251 help="Suppress warning messages about legacy config files"
252 252 )
253 253 quick = Bool(False, config=True,
254 254 help="""Start IPython quickly by skipping the loading of config files."""
255 255 )
256 256 def _quick_changed(self, name, old, new):
257 257 if new:
258 258 self.load_config_file = lambda *a, **kw: None
259 259 self.ignore_old_config=True
260 260
261 261 display_banner = Bool(True, config=True,
262 262 help="Whether to display a banner upon starting IPython."
263 263 )
264 264
265 265 # if there is code of files to run from the cmd line, don't interact
266 266 # unless the --i flag (App.force_interact) is true.
267 267 force_interact = Bool(False, config=True,
268 268 help="""If a command or file is given via the command-line,
269 269 e.g. 'ipython foo.py"""
270 270 )
271 271 def _force_interact_changed(self, name, old, new):
272 272 if new:
273 273 self.interact = True
274 274
275 275 def _file_to_run_changed(self, name, old, new):
276 276 if new:
277 277 self.something_to_run = True
278 278 if new and not self.force_interact:
279 279 self.interact = False
280 280 _code_to_run_changed = _file_to_run_changed
281 281 _module_to_run_changed = _file_to_run_changed
282 282
283 283 # internal, not-configurable
284 284 interact=Bool(True)
285 285 something_to_run=Bool(False)
286 286
287 287 def parse_command_line(self, argv=None):
288 288 """override to allow old '-pylab' flag with deprecation warning"""
289 289
290 290 argv = sys.argv[1:] if argv is None else argv
291 291
292 292 if '-pylab' in argv:
293 293 # deprecated `-pylab` given,
294 294 # warn and transform into current syntax
295 295 argv = argv[:] # copy, don't clobber
296 296 idx = argv.index('-pylab')
297 297 warn.warn("`-pylab` flag has been deprecated.\n"
298 298 " Use `--pylab` instead, or `--pylab=foo` to specify a backend.")
299 299 sub = '--pylab'
300 300 if len(argv) > idx+1:
301 301 # check for gui arg, as in '-pylab qt'
302 302 gui = argv[idx+1]
303 303 if gui in ('wx', 'qt', 'qt4', 'gtk', 'auto'):
304 304 sub = '--pylab='+gui
305 305 argv.pop(idx+1)
306 306 argv[idx] = sub
307 307
308 308 return super(TerminalIPythonApp, self).parse_command_line(argv)
309 309
310 310 @catch_config_error
311 311 def initialize(self, argv=None):
312 312 """Do actions after construct, but before starting the app."""
313 313 super(TerminalIPythonApp, self).initialize(argv)
314 314 if self.subapp is not None:
315 315 # don't bother initializing further, starting subapp
316 316 return
317 317 if not self.ignore_old_config:
318 318 check_for_old_config(self.ipython_dir)
319 319 # print self.extra_args
320 320 if self.extra_args and not self.something_to_run:
321 321 self.file_to_run = self.extra_args[0]
322 322 self.init_path()
323 323 # create the shell
324 324 self.init_shell()
325 325 # and draw the banner
326 326 self.init_banner()
327 327 # Now a variety of things that happen after the banner is printed.
328 328 self.init_gui_pylab()
329 329 self.init_extensions()
330 330 self.init_code()
331 331
332 332 def init_shell(self):
333 333 """initialize the InteractiveShell instance"""
334 334 # Create an InteractiveShell instance.
335 335 # shell.display_banner should always be False for the terminal
336 336 # based app, because we call shell.show_banner() by hand below
337 337 # so the banner shows *before* all extension loading stuff.
338 338 self.shell = TerminalInteractiveShell.instance(config=self.config,
339 339 display_banner=False, profile_dir=self.profile_dir,
340 340 ipython_dir=self.ipython_dir)
341 341 self.shell.configurables.append(self)
342 342
343 343 def init_banner(self):
344 344 """optionally display the banner"""
345 345 if self.display_banner and self.interact:
346 346 self.shell.show_banner()
347 347 # Make sure there is a space below the banner.
348 348 if self.log_level <= logging.INFO: print
349 349
350 350 def _pylab_changed(self, name, old, new):
351 351 """Replace --pylab='inline' with --pylab='auto'"""
352 352 if new == 'inline':
353 353 warn.warn("'inline' not available as pylab backend, "
354 354 "using 'auto' instead.")
355 355 self.pylab = 'auto'
356 356
357 357 def start(self):
358 358 if self.subapp is not None:
359 359 return self.subapp.start()
360 360 # perform any prexec steps:
361 361 if self.interact:
362 362 self.log.debug("Starting IPython's mainloop...")
363 363 self.shell.mainloop()
364 364 else:
365 365 self.log.debug("IPython not interactive...")
366 366
367 367
368 368 def load_default_config(ipython_dir=None):
369 369 """Load the default config file from the default ipython_dir.
370 370
371 371 This is useful for embedded shells.
372 372 """
373 373 if ipython_dir is None:
374 374 ipython_dir = get_ipython_dir()
375 375 profile_dir = os.path.join(ipython_dir, 'profile_default')
376 376 cl = PyFileConfigLoader(default_config_file_name, profile_dir)
377 377 try:
378 378 config = cl.load_config()
379 379 except ConfigFileNotFound:
380 380 # no config found
381 381 config = Config()
382 382 return config
383 383
384 384
385 385 def launch_new_instance():
386 386 """Create and run a full blown IPython instance"""
387 387 app = TerminalIPythonApp.instance()
388 388 app.initialize()
389 389 app.start()
390 390
391 391
392 392 if __name__ == '__main__':
393 393 launch_new_instance()
General Comments 0
You need to be logged in to leave comments. Login now