##// END OF EJS Templates
Merge pull request #3317 from minrk/fwrite...
Fernando Perez -
r10657:b7cb3331 merge
parent child Browse files
Show More
@@ -2055,11 +2055,14 b' class InteractiveShell(SingletonConfigurable):'
2055
2055
2056 # Register Magic Aliases
2056 # Register Magic Aliases
2057 mman = self.magics_manager
2057 mman = self.magics_manager
2058 # FIXME: magic aliases should be defined by the Magics classes
2059 # or in MagicsManager, not here
2058 mman.register_alias('ed', 'edit')
2060 mman.register_alias('ed', 'edit')
2059 mman.register_alias('hist', 'history')
2061 mman.register_alias('hist', 'history')
2060 mman.register_alias('rep', 'recall')
2062 mman.register_alias('rep', 'recall')
2061 mman.register_alias('SVG', 'svg', 'cell')
2063 mman.register_alias('SVG', 'svg', 'cell')
2062 mman.register_alias('HTML', 'html', 'cell')
2064 mman.register_alias('HTML', 'html', 'cell')
2065 mman.register_alias('file', 'writefile', 'cell')
2063
2066
2064 # FIXME: Move the color initialization to the DisplayHook, which
2067 # FIXME: Move the color initialization to the DisplayHook, which
2065 # should be split into a prompt manager and displayhook. We probably
2068 # should be split into a prompt manager and displayhook. We probably
@@ -707,12 +707,12 b' class OSMagics(Magics):'
707 help='file to write'
707 help='file to write'
708 )
708 )
709 @cell_magic
709 @cell_magic
710 def file(self, line, cell):
710 def writefile(self, line, cell):
711 """Write the contents of the cell to a file.
711 """Write the contents of the cell to a file.
712
712
713 The file will be overwritten unless the -a (--append) flag is specified.
713 The file will be overwritten unless the -a (--append) flag is specified.
714 """
714 """
715 args = magic_arguments.parse_argstring(self.file, line)
715 args = magic_arguments.parse_argstring(self.writefile, line)
716 filename = os.path.expanduser(unquote_filename(args.filename))
716 filename = os.path.expanduser(unquote_filename(args.filename))
717
717
718 if os.path.exists(filename):
718 if os.path.exists(filename):
General Comments 0
You need to be logged in to leave comments. Login now