From e37774f0bd5393fbc41aae7e94aa9dec17a81bce Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 5 May 2020 16:15:49 +1000 Subject: [PATCH] fix v1 log appearing next to export --- pylib/anki/collection.py | 3 ++- pylib/anki/storage.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pylib/anki/collection.py b/pylib/anki/collection.py index 296a1e74a..3e3294b9b 100644 --- a/pylib/anki/collection.py +++ b/pylib/anki/collection.py @@ -63,9 +63,10 @@ class _Collection: db: DBProxy, backend: RustBackend, server: Optional["anki.storage.ServerData"] = None, + log: bool = False, ) -> None: self.backend = backend - self._debugLog = not server + self._debugLog = log self.db = db self.path = db._path self._openLog() diff --git a/pylib/anki/storage.py b/pylib/anki/storage.py index 07b669e4e..b8a0bb8f6 100644 --- a/pylib/anki/storage.py +++ b/pylib/anki/storage.py @@ -41,7 +41,8 @@ def Collection( (media_dir, media_db) = media_paths_from_col_path(path) log_path = "" - if not server and log: + should_log = not server and log + if should_log: log_path = path.replace(".anki2", "2.log") path = os.path.abspath(path) @@ -55,7 +56,7 @@ def Collection( initial_db_setup(db) # add db to col and do any remaining upgrades - col = _Collection(db, backend=backend, server=server) + col = _Collection(db, backend=backend, server=server, log=should_log) if create: # add in reverse order so basic is default addClozeModel(col)