#NEWLINE# def delete_libs( self ) : #NEWLINE# #INDENT# 'If the `delete-safe` option is set to true, move the old libraries\n        directory to a temporary directory inside the parts dir instead of\n        deleting it.\n        ' #NEWLINE# if ( not os . path . exists ( self . lib_path ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( self . delete_safe is True ) : #NEWLINE# #INDENT# if ( not os . path . exists ( self . temp_dir ) ) : #NEWLINE# #INDENT# os . makedirs ( self . temp_dir ) #NEWLINE# #UNINDENT# date = datetime . datetime . now ( ) . strftime ( '_%Y_%m_%d_%H_%M_%S' ) #NEWLINE# filename = os . path . basename ( self . lib_path . rstrip ( os . sep ) ) #NEWLINE# if self . use_zip : #NEWLINE# #INDENT# filename = ( ( filename [ : ( - 4 ) ] + date ) + '.zip' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# filename += date #NEWLINE# #UNINDENT# dst = os . path . join ( self . temp_dir , filename ) #NEWLINE# shutil . move ( self . lib_path , dst ) #NEWLINE# self . logger . info ( ( 'Saved libraries backup in %r.' % dst ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . use_zip : #NEWLINE# #INDENT# os . remove ( self . lib_path ) #NEWLINE# self . logger . info ( ( 'Removed lib-zip %r.' % self . lib_path ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# shutil . rmtree ( self . lib_path ) #NEWLINE# self . logger . info ( ( 'Removed lib-directory %r.' % self . lib_path ) )