##// END OF EJS Templates
make that writefile
MinRK -
Show More
@@ -2055,12 +2055,13 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 # surely, this can't be were magics aliases should be defined?
2058 mman.register_alias('ed', 'edit')
2059 mman.register_alias('ed', 'edit')
2059 mman.register_alias('hist', 'history')
2060 mman.register_alias('hist', 'history')
2060 mman.register_alias('rep', 'recall')
2061 mman.register_alias('rep', 'recall')
2061 mman.register_alias('SVG', 'svg', 'cell')
2062 mman.register_alias('SVG', 'svg', 'cell')
2062 mman.register_alias('HTML', 'html', 'cell')
2063 mman.register_alias('HTML', 'html', 'cell')
2063 mman.register_alias('file', 'fwrite', 'cell')
2064 mman.register_alias('file', 'writefile', 'cell')
2064
2065
2065 # FIXME: Move the color initialization to the DisplayHook, which
2066 # FIXME: Move the color initialization to the DisplayHook, which
2066 # should be split into a prompt manager and displayhook. We probably
2067 # 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 fwrite(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.fwrite, 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