mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
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:
parent
1d2ef1dbfb
commit
2e22b6218b
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue