Пофиксил востановление из бэкапа, не резолвились пути

This commit is contained in:
Rustam Zaitov 2013-10-29 03:53:11 +04:00
parent 10a41bf1db
commit 5a717d273e
2 changed files with 6 additions and 4 deletions

View File

@ -14,8 +14,9 @@ class RestoreBackupCommand:
dirPairs = [(name, "backup.{0}".format(name)) for name in os.listdir(baseDir) if os.path.isdir(self.__pathProvider.resolveAbsPath(name)) and not name.startswith('backup.')]
for pair in dirPairs:
if not os.path.exists(pair[1]):
absPair = (self.__pathProvider.resolveAbsPath(pair[0]), self.__pathProvider.resolveAbsPath(pair[1]))
if not os.path.exists(absPair[1]):
continue
shutil.rmtree(pair[0]) # delete src
shutil.copytree(pair[1], pair[0]) # restore from backup
shutil.rmtree(absPair[0]) # delete src
shutil.copytree(absPair[1], absPair[0]) # restore from backup

View File

@ -2,5 +2,6 @@
#import ManualTests.info_plist_test
#import ManualTests.copy_test
#import ManualTests.create_backup_test
#import ManualTests.delete_backup_test
import ManualTests.delete_backup_test
import ManualTests.restore_backup_test