ae-sys-core 0.3.24__tar.gz → 0.3.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/LICENSE.md +1 -1
- {ae_sys_core-0.3.24/ae_sys_core.egg-info → ae_sys_core-0.3.26}/PKG-INFO +6 -6
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/README.md +5 -5
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/ae/sys_core.py +13 -12
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26/ae_sys_core.egg-info}/PKG-INFO +6 -6
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/pyproject.toml +1 -1
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/setup.py +7 -7
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/tests/test_sys_core.py +6 -14
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/ae_sys_core.egg-info/SOURCES.txt +0 -0
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/ae_sys_core.egg-info/dependency_links.txt +0 -0
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/ae_sys_core.egg-info/requires.txt +0 -0
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/ae_sys_core.egg-info/top_level.txt +0 -0
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/ae_sys_core.egg-info/zip-safe +0 -0
- {ae_sys_core-0.3.24 → ae_sys_core-0.3.26}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_sys_core
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.26
|
|
4
4
|
Summary: ae namespace module portion sys_core: dynamic system configuration, initialization and connection
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_sys_core
|
|
6
6
|
Author: AndiEcker
|
|
@@ -67,15 +67,15 @@ Dynamic: requires-dist
|
|
|
67
67
|
Dynamic: requires-python
|
|
68
68
|
Dynamic: summary
|
|
69
69
|
|
|
70
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
71
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
72
|
-
# sys_core 0.3.
|
|
70
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.101 -->
|
|
71
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
|
|
72
|
+
# sys_core 0.3.26
|
|
73
73
|
|
|
74
74
|
[](
|
|
75
75
|
https://gitlab.com/ae-group/ae_sys_core)
|
|
76
76
|
[](
|
|
78
|
+
https://gitlab.com/ae-group/ae_sys_core/-/tree/release0.3.26)
|
|
79
79
|
[](
|
|
80
80
|
https://pypi.org/project/ae-sys-core/#history)
|
|
81
81
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
2
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
3
|
-
# sys_core 0.3.
|
|
1
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.101 -->
|
|
2
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
|
|
3
|
+
# sys_core 0.3.26
|
|
4
4
|
|
|
5
5
|
[](
|
|
6
6
|
https://gitlab.com/ae-group/ae_sys_core)
|
|
7
7
|
[](
|
|
9
|
+
https://gitlab.com/ae-group/ae_sys_core/-/tree/release0.3.26)
|
|
10
10
|
[](
|
|
11
11
|
https://pypi.org/project/ae-sys-core/#history)
|
|
12
12
|
|
|
@@ -60,13 +60,13 @@ import importlib
|
|
|
60
60
|
|
|
61
61
|
from abc import ABC, abstractmethod
|
|
62
62
|
from collections import OrderedDict
|
|
63
|
-
from typing import Any,
|
|
63
|
+
from typing import Any, Optional, Sequence, Union, cast
|
|
64
64
|
|
|
65
65
|
from ae.core import DEBUG_LEVEL_DISABLED, DEBUG_LEVEL_VERBOSE, HIDDEN_CREDENTIALS # type: ignore # mypy
|
|
66
66
|
from ae.console import ConsoleApp # type: ignore # mypy doesn't find namespace pkg
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
__version__ = '0.3.
|
|
69
|
+
__version__ = '0.3.26'
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
SYS_SECTION_NAME = 'aeSystems' #: section name for system config variables
|
|
@@ -82,9 +82,9 @@ def config_value(var_name: str, console_app: ConsoleApp) -> Any:
|
|
|
82
82
|
:param console_app: ConsoleApp instance of the application providing these config options/variables.
|
|
83
83
|
:return: config variable value if found else None.
|
|
84
84
|
"""
|
|
85
|
-
val = console_app.
|
|
85
|
+
val = console_app.get_variable(var_name)
|
|
86
86
|
if val is None:
|
|
87
|
-
val = console_app.
|
|
87
|
+
val = console_app.get_variable(var_name, section=SYS_SECTION_NAME)
|
|
88
88
|
return val
|
|
89
89
|
|
|
90
90
|
|
|
@@ -92,8 +92,9 @@ class SystemBase:
|
|
|
92
92
|
""" instance represents an external system, including their system properties and a connection object. """
|
|
93
93
|
instances: int = 0
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
|
96
|
+
def __init__(self, sys_id: str, console_app: ConsoleApp, credentials: dict[str, str], features: Sequence[str] = (),
|
|
97
|
+
rec_types: Optional[dict[str, str]] = None):
|
|
97
98
|
""" create new :class:`SystemBase` instance.
|
|
98
99
|
|
|
99
100
|
:param sys_id: unique str to identify a system (also used as prefix/suffix).
|
|
@@ -106,7 +107,7 @@ class SystemBase:
|
|
|
106
107
|
self.console_app = console_app #: application instance and config environment
|
|
107
108
|
self.credentials = credentials #: credentials to connect to this system
|
|
108
109
|
self.features = features #: system specific features and configs
|
|
109
|
-
self.available_rec_types:
|
|
110
|
+
self.available_rec_types: dict[str, str] = \
|
|
110
111
|
rec_types or {} #: record types available in this system
|
|
111
112
|
|
|
112
113
|
self.connection: Any = None #: object with optional connect()/disconnect()/close() methods
|
|
@@ -130,7 +131,7 @@ class SystemBase:
|
|
|
130
131
|
ret += "@" + repr(self.console_app.app_name)
|
|
131
132
|
return ret
|
|
132
133
|
|
|
133
|
-
def connect(self, sys_config:
|
|
134
|
+
def connect(self, sys_config: dict[str, str], force_reconnect: bool = False) -> str:
|
|
134
135
|
""" connect this instance to his system using a system connector class.
|
|
135
136
|
|
|
136
137
|
:param sys_config: dict with the :ref:`dynamic config properties of this system <system-properties>`.
|
|
@@ -243,7 +244,7 @@ class UsedSystems(OrderedDict):
|
|
|
243
244
|
self.console_app.po(f"**** UsedSystems don't found the 'availableSystems' option or config variable"
|
|
244
245
|
f"in the config files ({self.console_app._cfg_files})")
|
|
245
246
|
return
|
|
246
|
-
self.available_systems:
|
|
247
|
+
self.available_systems: dict[str, dict[str, Union[dict[str, str], str]]]
|
|
247
248
|
if selected_systems:
|
|
248
249
|
self.available_systems = {k: v for k, v in conf_systems.items() if k in selected_systems}
|
|
249
250
|
else:
|
|
@@ -251,7 +252,7 @@ class UsedSystems(OrderedDict):
|
|
|
251
252
|
|
|
252
253
|
self._load_merge_cred_feat(entered_credentials)
|
|
253
254
|
|
|
254
|
-
def _load_merge_cred_feat(self, entered_credentials:
|
|
255
|
+
def _load_merge_cred_feat(self, entered_credentials: dict[str, str]):
|
|
255
256
|
""" load and initialize all used system configs and merge entered credentials into it.
|
|
256
257
|
|
|
257
258
|
:param entered_credentials: passed over unchanged from :class:`UsedSystems` - see
|
|
@@ -286,7 +287,7 @@ class UsedSystems(OrderedDict):
|
|
|
286
287
|
# finally add system to this used systems instance
|
|
287
288
|
self._add_system(sys_id, credentials, features=features)
|
|
288
289
|
|
|
289
|
-
def _add_system(self, sys_id: str, credentials:
|
|
290
|
+
def _add_system(self, sys_id: str, credentials: dict[str, str], features: Sequence[str] = ()):
|
|
290
291
|
""" add new :class:`SystemBase` instance to this :class:`UsedSystems` instance.
|
|
291
292
|
|
|
292
293
|
:param sys_id: system id.
|
|
@@ -295,7 +296,7 @@ class UsedSystems(OrderedDict):
|
|
|
295
296
|
"""
|
|
296
297
|
assert sys_id in self.available_systems, f"UsedSystems._add_system(): unsupported system id {sys_id}"
|
|
297
298
|
assert sys_id not in self._systems, f"UsedSystems._add_system(): system id {sys_id} already specified"
|
|
298
|
-
rec_types = cast(Optional[
|
|
299
|
+
rec_types = cast(Optional[dict[str, str]], self.available_systems[sys_id].get('available_rec_types'))
|
|
299
300
|
self._systems[sys_id] = SystemBase(sys_id, self.console_app, credentials, features, rec_types)
|
|
300
301
|
|
|
301
302
|
def connect(self, force_reconnect: bool = False) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_sys_core
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.26
|
|
4
4
|
Summary: ae namespace module portion sys_core: dynamic system configuration, initialization and connection
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_sys_core
|
|
6
6
|
Author: AndiEcker
|
|
@@ -67,15 +67,15 @@ Dynamic: requires-dist
|
|
|
67
67
|
Dynamic: requires-python
|
|
68
68
|
Dynamic: summary
|
|
69
69
|
|
|
70
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
71
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
72
|
-
# sys_core 0.3.
|
|
70
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.101 -->
|
|
71
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
|
|
72
|
+
# sys_core 0.3.26
|
|
73
73
|
|
|
74
74
|
[](
|
|
75
75
|
https://gitlab.com/ae-group/ae_sys_core)
|
|
76
76
|
[](
|
|
78
|
+
https://gitlab.com/ae-group/ae_sys_core/-/tree/release0.3.26)
|
|
79
79
|
[](
|
|
80
80
|
https://pypi.org/project/ae-sys-core/#history)
|
|
81
81
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.
|
|
1
|
+
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.59
|
|
2
2
|
""" setup of ae namespace module portion sys_core: dynamic system configuration, initialization and connection. """
|
|
3
3
|
# noinspection PyUnresolvedReferences
|
|
4
4
|
import sys
|
|
@@ -23,15 +23,15 @@ setup_kwargs = {
|
|
|
23
23
|
'install_requires': ['ae_base', 'ae_core', 'ae_console'],
|
|
24
24
|
'keywords': ['configuration', 'development', 'environment', 'productivity'],
|
|
25
25
|
'license': 'GPL-3.0-or-later',
|
|
26
|
-
'long_description': ('<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
27
|
-
'<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
28
|
-
'# sys_core 0.3.
|
|
26
|
+
'long_description': ('<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.101 -->\n'
|
|
27
|
+
'<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->\n'
|
|
28
|
+
'# sys_core 0.3.26\n'
|
|
29
29
|
'\n'
|
|
30
30
|
'[](\n'
|
|
31
31
|
' https://gitlab.com/ae-group/ae_sys_core)\n'
|
|
32
32
|
'[](\n'
|
|
34
|
+
' https://gitlab.com/ae-group/ae_sys_core/-/tree/release0.3.26)\n'
|
|
35
35
|
'[](\n'
|
|
36
36
|
' https://pypi.org/project/ae-sys-core/#history)\n'
|
|
37
37
|
'\n'
|
|
@@ -108,7 +108,7 @@ setup_kwargs = {
|
|
|
108
108
|
'Source': 'https://ae.readthedocs.io/en/latest/_modules/ae/sys_core.html'},
|
|
109
109
|
'python_requires': '>=3.9',
|
|
110
110
|
'url': 'https://gitlab.com/ae-group/ae_sys_core',
|
|
111
|
-
'version': '0.3.
|
|
111
|
+
'version': '0.3.26',
|
|
112
112
|
'zip_safe': True,
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
""" ae_sys_core unit tests """
|
|
2
|
-
from configparser import ConfigParser
|
|
3
2
|
import pytest
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
from configparser import ConfigParser
|
|
5
5
|
|
|
6
6
|
from ae.base import CFG_EXT
|
|
7
|
-
|
|
8
|
-
from ae.core import (DEBUG_LEVEL_DISABLED, DEBUG_LEVEL_ENABLED, DEBUG_LEVEL_VERBOSE, app_inst_lock, _APP_INSTANCES,
|
|
9
|
-
_unregister_app_instance)
|
|
7
|
+
from ae.core import DEBUG_LEVEL_DISABLED, DEBUG_LEVEL_ENABLED, DEBUG_LEVEL_VERBOSE
|
|
10
8
|
from ae.console import ConsoleApp
|
|
9
|
+
|
|
11
10
|
from ae.sys_core import SystemBase, SystemConnectorBase, UsedSystems
|
|
12
11
|
|
|
13
12
|
|
|
@@ -34,16 +33,9 @@ SYS_DICTS = {SS: {'connector_module': 'sys_core_test_mocks', 'connector_class':
|
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
@pytest.fixture
|
|
37
|
-
def console_app_env():
|
|
38
|
-
""" ConsoleApp with automatic option
|
|
39
|
-
old_argv = sys.argv
|
|
40
|
-
sys.argv = ['test_app_key', ]
|
|
36
|
+
def console_app_env(restore_app_env):
|
|
37
|
+
""" ConsoleApp with automatic option, sys.argv reset and app unregister. """
|
|
41
38
|
yield ConsoleApp('Console App Environment for ae.sys_core tests', additional_cfg_files=("tests/test" + CFG_EXT, ))
|
|
42
|
-
with app_inst_lock:
|
|
43
|
-
app_keys = list(_APP_INSTANCES.keys())[::-1]
|
|
44
|
-
for key in app_keys:
|
|
45
|
-
_unregister_app_instance(key) # remove app from ae.core app register/dict
|
|
46
|
-
sys.argv = old_argv
|
|
47
39
|
|
|
48
40
|
|
|
49
41
|
class TestConfig:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|