mirror of https://gitlab.com/pamhyr/pamhyr2
Pamhyr: Fix tests and pep8.
parent
4790b9c071
commit
c183e5016c
|
|
@ -356,6 +356,9 @@ class River(Graph, SQLSubModel):
|
||||||
|
|
||||||
def _db_save_delete_artefact_where_not_id(self, execute, data,
|
def _db_save_delete_artefact_where_not_id(self, execute, data,
|
||||||
table: str, els: list):
|
table: str, els: list):
|
||||||
|
if len(els) == 0:
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
execute(
|
execute(
|
||||||
f"DELETE FROM {table} " +
|
f"DELETE FROM {table} " +
|
||||||
|
|
|
||||||
|
|
@ -116,19 +116,23 @@ class Config(SQL):
|
||||||
|
|
||||||
if int(release) < 3:
|
if int(release) < 3:
|
||||||
self.execute(
|
self.execute(
|
||||||
f"INSERT OR IGNORE INTO data VALUES ('last_study', '')"
|
"INSERT OR IGNORE INTO data "+
|
||||||
|
"VALUES ('last_study', '')"
|
||||||
)
|
)
|
||||||
self.execute(
|
self.execute(
|
||||||
f"INSERT OR IGNORE INTO data VALUES ('close_correctly', 'True')"
|
"INSERT OR IGNORE INTO data " +
|
||||||
|
"VALUES ('close_correctly', 'True')"
|
||||||
)
|
)
|
||||||
|
|
||||||
if int(release) < 4:
|
if int(release) < 4:
|
||||||
self.execute(
|
self.execute(
|
||||||
f"INSERT OR IGNORE INTO data VALUES ('last_solver_name', '')"
|
"INSERT OR IGNORE INTO data " +
|
||||||
|
"VALUES ('last_solver_name', '')"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.execute(
|
self.execute(
|
||||||
f"UPDATE info SET value='{self._version}' WHERE key='version'"
|
f"UPDATE info SET value='{self._version}' " +
|
||||||
|
"WHERE key='version'"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.commit()
|
self.commit()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue