##// END OF EJS Templates
Load whole history on `%load` without parameters
Blazej Michalik -
Show More
@@ -308,6 +308,9 b' class CodeMagics(Magics):'
308 where source can be a filename, URL, input history range, macro, or
308 where source can be a filename, URL, input history range, macro, or
309 element in the user namespace
309 element in the user namespace
310
310
311 If no arguments are given, loads the history of this session up to this
312 point.
313
311 Options:
314 Options:
312
315
313 -r <lines>: Specify lines or ranges of lines to load from the source.
316 -r <lines>: Specify lines or ranges of lines to load from the source.
@@ -326,6 +329,7 b' class CodeMagics(Magics):'
326 confirmation before loading source with more than 200 000 characters, unless
329 confirmation before loading source with more than 200 000 characters, unless
327 -y flag is passed or if the frontend does not support raw_input::
330 -y flag is passed or if the frontend does not support raw_input::
328
331
332 %load
329 %load myscript.py
333 %load myscript.py
330 %load 7-27
334 %load 7-27
331 %load myMacro
335 %load myMacro
@@ -337,13 +341,7 b' class CodeMagics(Magics):'
337 %load -n my_module.wonder_function
341 %load -n my_module.wonder_function
338 """
342 """
339 opts,args = self.parse_options(arg_s,'yns:r:')
343 opts,args = self.parse_options(arg_s,'yns:r:')
340
341 if not args:
342 raise UsageError('Missing filename, URL, input history range, '
343 'macro, or element in the user namespace.')
344
345 search_ns = 'n' in opts
344 search_ns = 'n' in opts
346
347 contents = self.shell.find_user_code(args, search_ns=search_ns)
345 contents = self.shell.find_user_code(args, search_ns=search_ns)
348
346
349 if 's' in opts:
347 if 's' in opts:
General Comments 0
You need to be logged in to leave comments. Login now