don't close log on profile close

we want the log to stick around for syncs, and if the user
changes to another profile the log will be closed then
This commit is contained in:
Damien Elmes 2013-11-04 06:35:30 +09:00
parent 1d2ef1dbfb
commit 2e22b6218b

View file

@ -316,7 +316,6 @@ when the collection is stored on a network or cloud drive. Please see \
the manual for information on how to restore from an automatic backup.")) the manual for information on how to restore from an automatic backup."))
self.col.close() self.col.close()
self.col = None self.col = None
self._closeLog()
if not corrupt: if not corrupt:
self.backup() self.backup()
self.progress.finish() self.progress.finish()
@ -888,6 +887,8 @@ Difference to correct time: %s.""") % diffText
########################################################################## ##########################################################################
def onLog(self, args, kwargs): def onLog(self, args, kwargs):
if not self._logHnd:
return
def customRepr(x): def customRepr(x):
if isinstance(x, basestring): if isinstance(x, basestring):
return x return x
@ -905,9 +906,6 @@ Difference to correct time: %s.""") % diffText
lpath = re.sub("\.anki2$", ".log", self.pm.collectionPath()) lpath = re.sub("\.anki2$", ".log", self.pm.collectionPath())
self._logHnd = open(lpath, "ab") self._logHnd = open(lpath, "ab")
def _closeLog(self):
self._logHnd = None
# Schema modifications # Schema modifications
########################################################################## ##########################################################################