##// END OF EJS Templates
fix IPython embed documentation...
Paul Ivanov -
Show More
@@ -1,26 +1,9 b''
1 1 # encoding: utf-8
2 2 """
3 3 An embedded IPython shell.
4
5 Authors:
6
7 * Brian Granger
8 * Fernando Perez
9
10 Notes
11 -----
12 4 """
13
14 #-----------------------------------------------------------------------------
15 # Copyright (C) 2008-2011 The IPython Development Team
16 #
17 # Distributed under the terms of the BSD License. The full license is in
18 # the file COPYING, distributed as part of this software.
19 #-----------------------------------------------------------------------------
20
21 #-----------------------------------------------------------------------------
22 # Imports
23 #-----------------------------------------------------------------------------
5 # Copyright (c) IPython Development Team.
6 # Distributed under the terms of the Modified BSD License.
24 7
25 8 from __future__ import with_statement
26 9 from __future__ import print_function
@@ -38,10 +21,6 b' from IPython.utils.traitlets import Bool, CBool, Unicode'
38 21 from IPython.utils.io import ask_yes_no
39 22
40 23
41 #-----------------------------------------------------------------------------
42 # Classes and functions
43 #-----------------------------------------------------------------------------
44
45 24 # This is an additional magic that is exposed in embedded shells.
46 25 @magics_class
47 26 class EmbeddedMagics(Magics):
@@ -220,16 +199,6 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
220 199 if compile_flags is not None:
221 200 self.compile.flags = compile_flags
222 201
223 # Patch for global embedding to make sure that things don't overwrite
224 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
225 # FIXME. Test this a bit more carefully (the if.. is new)
226 # N.B. This can't now ever be called. Not sure what it was for.
227 # And now, since it wasn't called in the previous version, I'm
228 # commenting out these lines so they can't be called with my new changes
229 # --TK, 2011-12-10
230 #if local_ns is None and module is None:
231 # self.user_global_ns.update(__main__.__dict__)
232
233 202 # make sure the tab-completer has the correct frame information, so it
234 203 # actually completes using the frame's locals/globals
235 204 self.set_completer_frame()
@@ -265,10 +234,10 b' def embed(**kwargs):'
265 234 from IPython import embed
266 235 a = 10
267 236 b = 20
268 embed('First time')
237 embed(header='First time')
269 238 c = 30
270 239 d = 40
271 embed
240 embed()
272 241
273 242 Full customization can be done by passing a :class:`Config` in as the
274 243 config argument.
General Comments 0
You need to be logged in to leave comments. Login now