don't write log files when exporting

This commit is contained in:
Damien Elmes 2020-04-15 21:45:32 +10:00
parent 65cfcf9226
commit 16be20e2fa
2 changed files with 4 additions and 4 deletions

View file

@ -32,6 +32,7 @@ def Collection(
path: str,
backend: Optional[RustBackend] = None,
server: Optional[ServerData] = None,
log: bool = False,
) -> _Collection:
"Open a new or existing collection. Path must be unicode."
assert path.endswith(".anki2")
@ -40,7 +41,7 @@ def Collection(
(media_dir, media_db) = media_paths_from_col_path(path)
log_path = ""
if not server:
if not server and log:
log_path = path.replace(".anki2", "2.log")
path = os.path.abspath(path)

View file

@ -475,13 +475,12 @@ close the profile or restart Anki."""
return True
def _loadCollection(self):
cpath = self.pm.collectionPath()
self.col = Collection(cpath, backend=self.backend)
self.reopen()
self.setEnabled(True)
def reopen(self):
cpath = self.pm.collectionPath()
self.col = Collection(cpath, backend=self.backend)
self.col = Collection(cpath, backend=self.backend, log=True)
def unloadCollection(self, onsuccess: Callable) -> None:
def callback():