#NEWLINE# def filesavebox( msg = None , title = None , default = '' , filetypes = None ) : #NEWLINE# #INDENT# '\n    A file to get the name of a file to save.\n    Returns the name of a file, or None if user chose to cancel.\n\n    The "default" argument should contain a filename (i.e. the\n    current name of the file to be saved).  It may also be empty,\n    or contain a filemask that includes wildcards.\n\n    The "filetypes" argument works like the "filetypes" argument to\n    fileopenbox.\n\n    :param str msg: the msg to be displayed.\n    :param str title: the window title\n    :param str default: default filename to return\n    :param object filetypes: filemasks that a user can choose, e.g. " \\*.txt"\n    :return: the name of a file, or None if user chose to cancel\n    ' #NEWLINE# localRoot = Tk ( ) #NEWLINE# localRoot . withdraw ( ) #NEWLINE# ( initialbase , initialfile , initialdir , filetypes ) = fileboxSetup ( default , filetypes ) #NEWLINE# f = ut . tk_FileDialog . asksaveasfilename ( parent = localRoot , title = getFileDialogTitle ( msg , title ) , initialfile = initialfile , initialdir = initialdir , filetypes = filetypes ) #NEWLINE# localRoot . destroy ( ) #NEWLINE# if ( not f ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# return os . path . normpath ( title )