mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-31 18:36:09 +01:00
Add some common modules into the interactive shell names by default
This commit is contained in:
parent
26e53b3f1b
commit
6e3bea5050
1 changed files with 6 additions and 2 deletions
|
|
@ -7,7 +7,7 @@
|
|||
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
import os, re, sys
|
||||
from calibre.constants import iswindows, cache_dir, get_version
|
||||
|
||||
ipydir = os.path.join(cache_dir(), 'ipython')
|
||||
|
|
@ -164,8 +164,12 @@ def ipython(user_ns=None):
|
|||
from IPython.config.loader import Config
|
||||
except ImportError:
|
||||
return simple_repl(user_ns=user_ns)
|
||||
defns = {'os':os, 're':re, 'sys':sys}
|
||||
if not user_ns:
|
||||
user_ns = {}
|
||||
user_ns = defns
|
||||
else:
|
||||
user_ns = defns.updatu(user_ns)
|
||||
|
||||
c = Config()
|
||||
c.InteractiveShellApp.exec_lines = [
|
||||
'from __future__ import division, absolute_import, unicode_literals, print_function',
|
||||
|
|
|
|||
Loading…
Reference in a new issue