rework session management: interface to C#

This commit is contained in:
Florian Förster 2025-04-03 09:26:56 +02:00
parent d1d665e60a
commit 30641103ec
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[project] [project]
name = "delta-barth" name = "delta-barth"
version = "0.5.1" version = "0.5.2"
description = "workflows and pipelines for the Python-based Plugin of Delta Barth's ERP system" description = "workflows and pipelines for the Python-based Plugin of Delta Barth's ERP system"
authors = [ authors = [
{name = "Florian Förster", email = "f.foerster@d-opt.com"}, {name = "Florian Förster", email = "f.foerster@d-opt.com"},
@ -73,7 +73,7 @@ directory = "reports/coverage"
[tool.bumpversion] [tool.bumpversion]
current_version = "0.5.1" current_version = "0.5.2"
parse = """(?x) parse = """(?x)
(?P<major>0|[1-9]\\d*)\\. (?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\. (?P<minor>0|[1-9]\\d*)\\.

View File

@ -14,9 +14,11 @@ SESSION: Final[Session] = Session(HTTP_BASE_CONTENT_HEADERS)
def setup( def setup(
data_path: str, data_path: str,
base_url: str,
) -> None: # pragma: no cover ) -> None: # pragma: no cover
# at this point: no logging configured # at this point: no logging configured
SESSION.set_data_path(data_path) SESSION.set_data_path(data_path)
SESSION.set_base_url(base_url=base_url)
SESSION.setup() SESSION.setup()
logger.info("[EXT-CALL MANAGEMENT] Successfully set up current session") logger.info("[EXT-CALL MANAGEMENT] Successfully set up current session")
@ -37,6 +39,7 @@ def set_credentials(
logger.info("[EXT-CALL MANAGEMENT] Successfully set credentials for current session") logger.info("[EXT-CALL MANAGEMENT] Successfully set credentials for current session")
# ** not part of external API, only internal
def get_credentials() -> str: # pragma: no cover def get_credentials() -> str: # pragma: no cover
logger.info("[EXT-CALL MANAGEMENT] Getting credentials for current session...") logger.info("[EXT-CALL MANAGEMENT] Getting credentials for current session...")
creds = SESSION.creds creds = SESSION.creds
@ -44,12 +47,15 @@ def get_credentials() -> str: # pragma: no cover
return creds.model_dump_json() return creds.model_dump_json()
# ** legacy: not part of external API
def set_base_url( def set_base_url(
base_url: str, base_url: str,
) -> None: # pragma: no cover ) -> None: # pragma: no cover
SESSION.set_base_url(base_url=base_url) SESSION.set_base_url(base_url=base_url)
def get_data_path() -> str: # pragma: no cover
return str(SESSION.data_path)
def get_base_url() -> str: # pragma: no cover def get_base_url() -> str: # pragma: no cover
return SESSION.base_url return SESSION.base_url