##// END OF EJS Templates
fix IPython embed documentation...
Paul Ivanov -
Show More
@@ -1,26 +1,9 b''
1 # encoding: utf-8
1 # encoding: utf-8
2 """
2 """
3 An embedded IPython shell.
3 An embedded IPython shell.
4
5 Authors:
6
7 * Brian Granger
8 * Fernando Perez
9
10 Notes
11 -----
12 """
4 """
13
5 # Copyright (c) IPython Development Team.
14 #-----------------------------------------------------------------------------
6 # Distributed under the terms of the Modified BSD License.
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 #-----------------------------------------------------------------------------
24
7
25 from __future__ import with_statement
8 from __future__ import with_statement
26 from __future__ import print_function
9 from __future__ import print_function
@@ -38,10 +21,6 b' from IPython.utils.traitlets import Bool, CBool, Unicode'
38 from IPython.utils.io import ask_yes_no
21 from IPython.utils.io import ask_yes_no
39
22
40
23
41 #-----------------------------------------------------------------------------
42 # Classes and functions
43 #-----------------------------------------------------------------------------
44
45 # This is an additional magic that is exposed in embedded shells.
24 # This is an additional magic that is exposed in embedded shells.
46 @magics_class
25 @magics_class
47 class EmbeddedMagics(Magics):
26 class EmbeddedMagics(Magics):
@@ -220,16 +199,6 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
220 if compile_flags is not None:
199 if compile_flags is not None:
221 self.compile.flags = compile_flags
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 # make sure the tab-completer has the correct frame information, so it
202 # make sure the tab-completer has the correct frame information, so it
234 # actually completes using the frame's locals/globals
203 # actually completes using the frame's locals/globals
235 self.set_completer_frame()
204 self.set_completer_frame()
@@ -265,10 +234,10 b' def embed(**kwargs):'
265 from IPython import embed
234 from IPython import embed
266 a = 10
235 a = 10
267 b = 20
236 b = 20
268 embed('First time')
237 embed(header='First time')
269 c = 30
238 c = 30
270 d = 40
239 d = 40
271 embed
240 embed()
272
241
273 Full customization can be done by passing a :class:`Config` in as the
242 Full customization can be done by passing a :class:`Config` in as the
274 config argument.
243 config argument.
General Comments 0
You need to be logged in to leave comments. Login now