#NEWLINE# def recordMove( self , src , dest ) : #NEWLINE# #INDENT# destdir = util . normpath ( self . macros . destdir ) #NEWLINE# def _removeDestDir( p ) : #NEWLINE# #INDENT# p = util . normpath ( p ) #NEWLINE# if ( p [ : len ( destdir ) ] == destdir ) : #NEWLINE# #INDENT# return p [ len ( destdir ) : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return p #NEWLINE# #UNINDENT# #UNINDENT# if os . path . isdir ( src ) : #NEWLINE# #INDENT# baseDir = src #NEWLINE# postRename = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . path . isdir ( dest ) : #NEWLINE# #INDENT# baseDir = dest #NEWLINE# postRename = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# baseDir = None #NEWLINE# #UNINDENT# #UNINDENT# src = _removeDestDir ( src ) #NEWLINE# dest = _removeDestDir ( dest ) #NEWLINE# self . _pathTranslations . append ( ( src , dest ) ) #NEWLINE# if baseDir : #NEWLINE# #INDENT# for ( base , dirs , files ) in os . walk ( baseDir ) : #NEWLINE# #INDENT# for path in ( dirs + files ) : #NEWLINE# #INDENT# if ( not postRename ) : #NEWLINE# #INDENT# fSrc = os . path . join ( base , path ) #NEWLINE# fSrc = fSrc . replace ( self . macros . destdir , '' ) #NEWLINE# fDest = fSrc . replace ( dirs , dest ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fDest = os . path . join ( base , path ) #NEWLINE# fDest = fDest . replace ( self . macros . destdir , '' ) #NEWLINE# fSrc = fDest . replace ( dest , src ) #NEWLINE# #UNINDENT# self . _pathTranslations . append ( ( fSrc , fDest ) )