#NEWLINE# def rename_file( self , name , newname , safe = False ) : #NEWLINE# #INDENT# if ( name not in self . files ) : #NEWLINE# #INDENT# raise NameError ( ( 'File %r does not exist' % name ) ) #NEWLINE# #UNINDENT# if ( safe and ( newname in self . files ) ) : #NEWLINE# #INDENT# raise NameError ( ( 'File %r exists' % newname ) ) #NEWLINE# #UNINDENT# content = self . files [ name ] #NEWLINE# del self . files [ name ] #NEWLINE# self . files [ newname ] = content