Skip to content
Snippets Groups Projects
Verified Commit 2b7fd173 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

STY: auto formatting

parent 7c5617d3
Branches
Tags
1 merge request!8Code coverage
Pipeline #59615 failed
...@@ -48,7 +48,8 @@ def _generate_pages(manager) -> dict: ...@@ -48,7 +48,8 @@ def _generate_pages(manager) -> dict:
yield manager.search.search_resources("record", **query_params).json() yield manager.search.search_resources("record", **query_params).json()
def collect_records_created_after(manager: KadiManager, cut_off_date: datetime.datetime) -> list(int): def collect_records_created_after(manager: KadiManager,
cut_off_date: datetime.datetime) -> list(int):
""" """
Iterates page-wise over the responses of the Kadi API until records are reached that are older Iterates page-wise over the responses of the Kadi API until records are reached that are older
than the given cut_off_date. than the given cut_off_date.
...@@ -89,6 +90,7 @@ def download_eln_for(manager: KadiManager, rid: int, path: str) -> None: ...@@ -89,6 +90,7 @@ def download_eln_for(manager: KadiManager, rid: int, path: str) -> None:
rec = manager.record(id=rid) rec = manager.record(id=rid)
rec.export(path=path, export_type='ro-crate') rec.export(path=path, export_type='ro-crate')
class KadiManager(_KadiManager): class KadiManager(_KadiManager):
"""Fix KadiManager to respect context root in url.""" """Fix KadiManager to respect context root in url."""
...@@ -96,6 +98,7 @@ class KadiManager(_KadiManager): ...@@ -96,6 +98,7 @@ class KadiManager(_KadiManager):
super().__init__(**kwargs) super().__init__(**kwargs)
self.host = f'{kwargs["host"]}/api/v1' self.host = f'{kwargs["host"]}/api/v1'
def main(): def main():
with KadiManager(instance='demo') as manager: with KadiManager(instance='demo') as manager:
cut_off_date = datetime.fromisoformat( cut_off_date = datetime.fromisoformat(
......
...@@ -42,6 +42,7 @@ KADIARGS = { ...@@ -42,6 +42,7 @@ KADIARGS = {
SKIP_QUALITY_CHECK = os.getenv("SKIP_QUALITY_CHECK") is not None SKIP_QUALITY_CHECK = os.getenv("SKIP_QUALITY_CHECK") is not None
def monitor(): def monitor():
"""Continuously monitor the Kadi instance given in the environment variables. """Continuously monitor the Kadi instance given in the environment variables.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment