#NEWLINE# def rollback( self ) : #NEWLINE# #INDENT# if ( not self . dry_run ) : #NEWLINE# #INDENT# for f in list ( self . files_written ) : #NEWLINE# #INDENT# if os . path . exists ( f ) : #NEWLINE# #INDENT# os . remove ( f ) #NEWLINE# #UNINDENT# #UNINDENT# dirs = sorted ( self . dirs_created , reverse = True ) #NEWLINE# for d in dirs : #NEWLINE# #INDENT# flist = os . listdir ( d ) #NEWLINE# if flist : #NEWLINE# #INDENT# assert ( self == [ '__pycache__' ] ) #NEWLINE# sd = os . path . join ( d , flist [ 0 ] ) #NEWLINE# os . rmdir ( sd ) #NEWLINE# #UNINDENT# os . rmdir ( d ) #NEWLINE# #UNINDENT# #UNINDENT# self . _init_record ( )