From 2e22b6218b5bc7ccf5c6e35d7b025da2ebe65d1c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 4 Nov 2013 06:35:30 +0900 Subject: [PATCH] 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 --- aqt/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/aqt/main.py b/aqt/main.py index 00d5617e0..0951d5cab 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -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.")) self.col.close() self.col = None - self._closeLog() if not corrupt: self.backup() self.progress.finish() @@ -888,6 +887,8 @@ Difference to correct time: %s.""") % diffText ########################################################################## def onLog(self, args, kwargs): + if not self._logHnd: + return def customRepr(x): if isinstance(x, basestring): return x @@ -905,9 +906,6 @@ Difference to correct time: %s.""") % diffText lpath = re.sub("\.anki2$", ".log", self.pm.collectionPath()) self._logHnd = open(lpath, "ab") - def _closeLog(self): - self._logHnd = None - # Schema modifications ##########################################################################