mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
drop some unused properties
This commit is contained in:
parent
605ad1c9ee
commit
9445e2ee22
1 changed files with 14 additions and 35 deletions
|
@ -177,42 +177,18 @@ class Collection:
|
||||||
|
|
||||||
# legacy properties; these will likely go away in the future
|
# legacy properties; these will likely go away in the future
|
||||||
|
|
||||||
def _get_crt(self) -> int:
|
@property
|
||||||
|
def crt(self) -> int:
|
||||||
return self.db.scalar("select crt from col")
|
return self.db.scalar("select crt from col")
|
||||||
|
|
||||||
def _set_crt(self, val: int) -> None:
|
@crt.setter
|
||||||
self.db.execute("update col set crt=?", val)
|
def crt(self, crt: int) -> None:
|
||||||
|
self.db.execute("update col set crt = ?", crt)
|
||||||
|
|
||||||
def _get_scm(self) -> int:
|
@property
|
||||||
return self.db.scalar("select scm from col")
|
def mod(self) -> int:
|
||||||
|
|
||||||
def _set_scm(self, val: int) -> None:
|
|
||||||
self.db.execute("update col set scm=?", val)
|
|
||||||
|
|
||||||
def _get_usn(self) -> int:
|
|
||||||
return self.db.scalar("select usn from col")
|
|
||||||
|
|
||||||
def _set_usn(self, val: int) -> None:
|
|
||||||
self.db.execute("update col set usn=?", val)
|
|
||||||
|
|
||||||
def _get_mod(self) -> int:
|
|
||||||
return self.db.scalar("select mod from col")
|
return self.db.scalar("select mod from col")
|
||||||
|
|
||||||
def _set_mod(self, val: int) -> None:
|
|
||||||
self.db.execute("update col set mod=?", val)
|
|
||||||
|
|
||||||
def _get_ls(self) -> int:
|
|
||||||
return self.db.scalar("select ls from col")
|
|
||||||
|
|
||||||
def _set_ls(self, val: int) -> None:
|
|
||||||
self.db.execute("update col set ls=?", val)
|
|
||||||
|
|
||||||
crt = property(_get_crt, _set_crt)
|
|
||||||
mod = property(_get_mod, _set_mod)
|
|
||||||
_usn = property(_get_usn, _set_usn)
|
|
||||||
scm = property(_get_scm, _set_scm)
|
|
||||||
ls = property(_get_ls, _set_ls)
|
|
||||||
|
|
||||||
# legacy
|
# legacy
|
||||||
def setMod(self) -> None:
|
def setMod(self) -> None:
|
||||||
# this is now a no-op, as modifications to things like the config
|
# this is now a no-op, as modifications to things like the config
|
||||||
|
@ -324,12 +300,15 @@ class Collection:
|
||||||
self.scm = intTime(1000)
|
self.scm = intTime(1000)
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def schemaChanged(self) -> Any:
|
def schemaChanged(self) -> bool:
|
||||||
"True if schema changed since last sync."
|
"True if schema changed since last sync."
|
||||||
return self.scm > self.ls
|
return self.db.scalar("select scm > ls from col")
|
||||||
|
|
||||||
def usn(self) -> Any:
|
def usn(self) -> int:
|
||||||
return self._usn if self.server else -1
|
if self.server:
|
||||||
|
return self.db.scalar("select usn from col")
|
||||||
|
else:
|
||||||
|
return -1
|
||||||
|
|
||||||
def beforeUpload(self) -> None:
|
def beforeUpload(self) -> None:
|
||||||
"Called before a full upload."
|
"Called before a full upload."
|
||||||
|
|
Loading…
Reference in a new issue