mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 05:07:10 -05:00
drop progress handler and timeout arg
This commit is contained in:
parent
8ef28f8571
commit
c8b9afac0c
2 changed files with 3 additions and 6 deletions
|
|
@ -11,8 +11,8 @@ from typing import Any, List, Type
|
|||
|
||||
|
||||
class DBProxy:
|
||||
def __init__(self, path: str, timeout: int = 0) -> None:
|
||||
self._db = sqlite.connect(path, timeout=timeout)
|
||||
def __init__(self, path: str) -> None:
|
||||
self._db = sqlite.connect(path, timeout=0)
|
||||
self._path = path
|
||||
self.mod = False
|
||||
|
||||
|
|
@ -69,9 +69,6 @@ class DBProxy:
|
|||
self._db.text_factory = None
|
||||
self._db.close()
|
||||
|
||||
def set_progress_handler(self, *args) -> None:
|
||||
self._db.set_progress_handler(*args)
|
||||
|
||||
def __enter__(self) -> "DBProxy":
|
||||
self._db.execute("begin")
|
||||
return self
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class ProgressManager:
|
|||
"Install a handler in the current DB."
|
||||
self.lastDbProgress = 0
|
||||
self.inDB = False
|
||||
db.set_progress_handler(self._dbProgress, 10000)
|
||||
#db.set_progress_handler(self._dbProgress, 10000)
|
||||
|
||||
def _dbProgress(self):
|
||||
"Called from SQLite."
|
||||
|
|
|
|||
Loading…
Reference in a new issue