##// END OF EJS Templates
Change order in which things are tried in %edit, so filenames starting with numbers can be edited....
Thomas Kluyver -
Show More
@@ -2275,15 +2275,13 b' Currently the magic system has the following functions:\\n"""'
2275 use_temp = True
2275 use_temp = True
2276
2276
2277 data = ''
2277 data = ''
2278 if args[0].isdigit():
2278 if args.endswith('.py'):
2279 # Mode where user specifies ranges of lines, like in %macro.
2280 # This means that you can't edit files whose names begin with
2281 # numbers this way. Tough.
2282 data = self.extract_input_lines(args, opts_raw)
2283 elif args.endswith('.py'):
2284 filename = make_filename(args)
2279 filename = make_filename(args)
2285 use_temp = False
2280 use_temp = False
2286 elif args:
2281 elif args:
2282 # Mode where user specifies ranges of lines, like in %macro.
2283 data = self.extract_input_lines(args, opts_raw)
2284 if not data:
2287 try:
2285 try:
2288 # Load the parameter given as a variable. If not a string,
2286 # Load the parameter given as a variable. If not a string,
2289 # process it as an object instead (below)
2287 # process it as an object instead (below)
@@ -2370,7 +2368,7 b' Currently the magic system has the following functions:\\n"""'
2370 print
2368 print
2371 else:
2369 else:
2372 print 'done. Executing edited code...'
2370 print 'done. Executing edited code...'
2373 if opts_r:
2371 if opts_raw:
2374 self.shell.run_cell(file_read(filename))
2372 self.shell.run_cell(file_read(filename))
2375 else:
2373 else:
2376 self.shell.safe_execfile(filename,self.shell.user_ns,
2374 self.shell.safe_execfile(filename,self.shell.user_ns,
General Comments 0
You need to be logged in to leave comments. Login now