##// END OF EJS Templates
Minor syntax cleanup and silification....
Matthias Bussonnier -
Show More
@@ -85,7 +85,17 b' def _new_id():'
85 return b2a_hex(os.urandom(16)).decode('ascii')
85 return b2a_hex(os.urandom(16)).decode('ascii')
86
86
87
87
88 def display(*objs, include=None, exclude=None, metadata=None, transient=None, display_id=None, **kwargs):
88 def display(
89 *objs,
90 include=None,
91 exclude=None,
92 metadata=None,
93 transient=None,
94 display_id=None,
95 raw=False,
96 clear=False,
97 **kwargs
98 ):
89 """Display a Python object in all frontends.
99 """Display a Python object in all frontends.
90
100
91 By default all representations will be computed and sent to the frontends.
101 By default all representations will be computed and sent to the frontends.
@@ -242,8 +252,6 b' def display(*objs, include=None, exclude=None, metadata=None, transient=None, di'
242 print(*objs)
252 print(*objs)
243 return
253 return
244
254
245 raw = kwargs.pop("raw", False)
246 clear = kwargs.pop("clear", False)
247 if transient is None:
255 if transient is None:
248 transient = {}
256 transient = {}
249 if metadata is None:
257 if metadata is None:
@@ -636,7 +636,7 b' class Magics(Configurable):'
636 '%s ( allowed: "%s" %s)' % (e.msg, opt_str, " ".join(long_opts))
636 '%s ( allowed: "%s" %s)' % (e.msg, opt_str, " ".join(long_opts))
637 ) from e
637 ) from e
638 for o, a in opts:
638 for o, a in opts:
639 if mode is "string" and preserve_non_opts:
639 if mode == "string" and preserve_non_opts:
640 # remove option-parts from the original args-string and preserve remaining-part.
640 # remove option-parts from the original args-string and preserve remaining-part.
641 # This relies on the arg_split(...) and getopt(...)'s impl spec, that the parsed options are
641 # This relies on the arg_split(...) and getopt(...)'s impl spec, that the parsed options are
642 # returned in the original order.
642 # returned in the original order.
@@ -334,7 +334,7 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
334 self.compile.flags = orig_compile_flags
334 self.compile.flags = orig_compile_flags
335
335
336
336
337 def embed(**kwargs):
337 def embed(*, header="", compile_flags=None, **kwargs):
338 """Call this to embed IPython at the current point in your program.
338 """Call this to embed IPython at the current point in your program.
339
339
340 The first invocation of this will create an :class:`InteractiveShellEmbed`
340 The first invocation of this will create an :class:`InteractiveShellEmbed`
@@ -360,8 +360,6 b' def embed(**kwargs):'
360 config argument.
360 config argument.
361 """
361 """
362 config = kwargs.get('config')
362 config = kwargs.get('config')
363 header = kwargs.pop('header', u'')
364 compile_flags = kwargs.pop('compile_flags', None)
365 if config is None:
363 if config is None:
366 config = load_default_config()
364 config = load_default_config()
367 config.InteractiveShellEmbed = config.TerminalInteractiveShell
365 config.InteractiveShellEmbed = config.TerminalInteractiveShell
General Comments 0
You need to be logged in to leave comments. Login now