#NEWLINE# def _restore( self , filename ) : #NEWLINE# #INDENT# ipath = path . normpath ( path . join ( self . installpath , filename ) ) #NEWLINE# bpath = path . normpath ( path . join ( self . backuppath , filename ) ) #NEWLINE# idir = path . dirname ( ipath ) #NEWLINE# if ( not path . isdir ( idir ) ) : #NEWLINE# #INDENT# os . makedirs ( idir ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# if path . isfile ( ipath ) : #NEWLINE# #INDENT# log . debug ( 'Removing file {0} before restoring old version' . format ( filename ) ) #NEWLINE# os . remove ( ipath ) #NEWLINE# #UNINDENT# log . debug ( 'Restoring file {0} by moving from backup directory' . format ( filename ) ) #NEWLINE# shutil . move ( self , ipath ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# log . debug ( 'Restore failed for {0}' . format ( filename ) )