env var to skip expensive closing during dev

This commit is contained in:
Damien Elmes 2013-10-22 14:28:17 +09:00
parent cf51f33c66
commit 004998c8ec

View File

@ -290,7 +290,10 @@ how to restore from a backup.""")
return return
self.maybeOptimize() self.maybeOptimize()
self.progress.start(immediate=True) self.progress.start(immediate=True)
corrupt = self.col.db.scalar("pragma integrity_check") != "ok" if os.getenv("ANKIDEV", 0):
corrupt = False
else:
corrupt = self.col.db.scalar("pragma integrity_check") != "ok"
if corrupt: if corrupt:
showWarning(_("Your collection file appears to be corrupt. \ showWarning(_("Your collection file appears to be corrupt. \
This can happen when the file is copied or moved while Anki is open, or \ This can happen when the file is copied or moved while Anki is open, or \
@ -309,7 +312,7 @@ the manual for information on how to restore from an automatic backup."))
def backup(self): def backup(self):
nbacks = self.pm.profile['numBackups'] nbacks = self.pm.profile['numBackups']
if not nbacks: if not nbacks or os.getenv("ANKIDEV", 0):
return return
dir = self.pm.backupFolder() dir = self.pm.backupFolder()
path = self.pm.collectionPath() path = self.pm.collectionPath()