correct typing errors
Some checks failed
Mypy / mypy (push) Failing after 45s
Pytest / pytest (3.12) (push) Failing after 48s
Pytest / pytest (3.14) (push) Failing after 45s
Ruff / ruff (push) Failing after 33s
Pytest / pytest (3.13) (push) Failing after 48s

This commit is contained in:
Justus Kuhlmann 2025-12-04 11:49:52 +01:00
commit d104d994f8
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6
4 changed files with 14 additions and 11 deletions

View file

@ -6,7 +6,7 @@ from .git_tools import move_submodule
import shutil
from .find import _project_lookup_by_id
from .tools import list2str, str2list
from .tracker import get_file
from .tracker import get
from typing import Union, Optional
@ -26,7 +26,7 @@ def create_project(path: str, uuid: str, owner: Union[str, None]=None, tags: Uni
The code that was used to create the measurements.
"""
db = path + "/backlogger.db"
get_file(path, "backlogger.db")
get(path, "backlogger.db")
conn = sqlite3.connect(db)
c = conn.cursor()
known_projects = c.execute("SELECT * FROM projects WHERE id=?", (uuid,))
@ -47,7 +47,7 @@ def create_project(path: str, uuid: str, owner: Union[str, None]=None, tags: Uni
def update_project_data(path: str, uuid: str, prop: str, value: Union[str, None] = None) -> None:
get_file(path, "backlogger.db")
get(path, "backlogger.db")
conn = sqlite3.connect(os.path.join(path, "backlogger.db"))
c = conn.cursor()
c.execute(f"UPDATE projects SET '{prop}' = '{value}' WHERE id == '{uuid}'")
@ -58,7 +58,7 @@ def update_project_data(path: str, uuid: str, prop: str, value: Union[str, None]
def update_aliases(path: str, uuid: str, aliases: list[str]) -> None:
db = os.path.join(path, "backlogger.db")
get_file(path, "backlogger.db")
get(path, "backlogger.db")
known_data = _project_lookup_by_id(db, uuid)[0]
known_aliases = known_data[1]
@ -123,7 +123,7 @@ def import_project(path: str, url: str, owner: Union[str, None]=None, tags: Opti
raise ValueError("The dataset does not have a uuid!")
if not os.path.exists(path + "/projects/" + uuid):
db = path + "/backlogger.db"
get_file(path, "backlogger.db")
get(path, "backlogger.db")
dl.unlock(db, dataset=path)
create_project(path, uuid, owner, tags, aliases, code)
move_submodule(path, 'projects/tmp', 'projects/' + uuid)