#NEWLINE# def get_available_name( self , name ) : #NEWLINE# #INDENT# '\n        In order to prevent file overwriting one another this will generate\n        a new filename with the format `YYMMDD.uniquehash.filename.extension`\n        ' #NEWLINE# filename_format = '{path}/{date}.{filename}' #NEWLINE# try : #NEWLINE# #INDENT# clean_name = self . _clean_name ( name ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# clean_name = name #NEWLINE# #UNINDENT# date = datetime . now ( ) . strftime ( '%y%m%d' ) #NEWLINE# splitname = clean_name . rsplit ( '/' , 1 ) #NEWLINE# final_name = filename_format . format ( path = filename_format [ 0 ] , date = date , filename = uniqify_filename ( splitname [ 1 ] ) ) #NEWLINE# return final_name