ka-uts-com 2.0.0.250407__py3-none-any.whl → 2.1.1.250415__py3-none-any.whl
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.
- ka_uts_com/__version__.py +1 -1
- ka_uts_com/{base/app_.py → app.py} +8 -8
- ka_uts_com/{base/cfg_.py → cfg.py} +8 -7
- ka_uts_com/com.py +47 -47
- build/lib/ka_uts_com/base/exit_.py → ka_uts_com/exit.py +1 -1
- ka_uts_com/timer.py +1 -1
- ka_uts_com-2.1.1.250415.dist-info/METADATA +910 -0
- ka_uts_com-2.1.1.250415.dist-info/RECORD +14 -0
- {ka_uts_com-2.0.0.250407.dist-info → ka_uts_com-2.1.1.250415.dist-info}/top_level.txt +0 -1
- build/lib/ka_uts_com/__init__.py +0 -0
- build/lib/ka_uts_com/__version__.py +0 -10
- build/lib/ka_uts_com/base/app_.py +0 -50
- build/lib/ka_uts_com/base/cfg_.py +0 -35
- build/lib/ka_uts_com/base/log_.py +0 -131
- build/lib/ka_uts_com/com.py +0 -121
- build/lib/ka_uts_com/data/__init__.py +0 -0
- build/lib/ka_uts_com/data/log.std.yml +0 -107
- build/lib/ka_uts_com/data/log.usr.yml +0 -106
- build/lib/ka_uts_com/decorators/dec.py +0 -13
- build/lib/ka_uts_com/fnc.py +0 -42
- build/lib/ka_uts_com/ioc/jinja2_.py +0 -42
- build/lib/ka_uts_com/ioc/yaml_.py +0 -30
- build/lib/ka_uts_com/log.py +0 -86
- build/lib/ka_uts_com/py.typed +0 -0
- build/lib/ka_uts_com/timer.py +0 -69
- build/lib/ka_uts_com/utils/aoeqstmt.py +0 -37
- build/lib/ka_uts_com/utils/date.py +0 -15
- build/lib/ka_uts_com/utils/doeq.py +0 -99
- build/lib/ka_uts_com/utils/pacmod.py +0 -123
- build/lib/ka_uts_com/utils/str.py +0 -265
- ka_uts_com/base/exit_.py +0 -37
- ka_uts_com/base/log_.py +0 -131
- ka_uts_com/data/__init__.py +0 -0
- ka_uts_com/data/log.std.yml +0 -107
- ka_uts_com/data/log.usr.yml +0 -106
- ka_uts_com/fnc.py +0 -42
- ka_uts_com/ioc/jinja2_.py +0 -42
- ka_uts_com/ioc/yaml_.py +0 -30
- ka_uts_com/log.py +0 -86
- ka_uts_com/utils/aoeqstmt.py +0 -37
- ka_uts_com/utils/date.py +0 -15
- ka_uts_com/utils/doeq.py +0 -99
- ka_uts_com/utils/pacmod.py +0 -123
- ka_uts_com/utils/str.py +0 -265
- ka_uts_com-2.0.0.250407.dist-info/METADATA +0 -1611
- ka_uts_com-2.0.0.250407.dist-info/RECORD +0 -49
- {ka_uts_com-2.0.0.250407.dist-info → ka_uts_com-2.1.1.250415.dist-info}/WHEEL +0 -0
- {ka_uts_com-2.0.0.250407.dist-info → ka_uts_com-2.1.1.250415.dist-info}/licenses/LICENSE.txt +0 -0
ka_uts_com/__version__.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
__title__ = 'ka_uts_com'
|
2
2
|
__description__ = 'Communication Utilities.'
|
3
3
|
__url__ = 'https://ka-ut-com.readthedocs.io/en/latest'
|
4
|
-
__version__ = '2.
|
4
|
+
__version__ = '2.1.1.250415'
|
5
5
|
__build__ = 0x022200
|
6
6
|
__author__ = 'Bernd Stroehle'
|
7
7
|
__author_email__ = 'bernd.stroehle@gmail.com'
|
@@ -3,8 +3,8 @@ from typing import Any
|
|
3
3
|
|
4
4
|
from logging import Logger
|
5
5
|
|
6
|
-
from
|
7
|
-
from
|
6
|
+
from ka_uts_uts.utils.pacmod import PacMod
|
7
|
+
from ka_uts_uts.ioc.yaml_ import Yaml_
|
8
8
|
|
9
9
|
TyAny = Any
|
10
10
|
TyArr = list[Any]
|
@@ -18,7 +18,7 @@ TnBool = None | bool
|
|
18
18
|
TnDic = None | TyDic
|
19
19
|
|
20
20
|
|
21
|
-
class
|
21
|
+
class App:
|
22
22
|
"""Aplication Class
|
23
23
|
"""
|
24
24
|
sw_init: TyBool = False
|
@@ -29,7 +29,7 @@ class App_:
|
|
29
29
|
app: TyDic = {}
|
30
30
|
|
31
31
|
@classmethod
|
32
|
-
def init(cls,
|
32
|
+
def init(cls, cls_com, **kwargs) -> None:
|
33
33
|
if cls.sw_init:
|
34
34
|
return
|
35
35
|
cls.sw_init = True
|
@@ -37,14 +37,14 @@ class App_:
|
|
37
37
|
cls.sw_replace_keys = kwargs.get('sw_replace_keys', False)
|
38
38
|
if cls.sw_replace_keys:
|
39
39
|
try:
|
40
|
-
cls.keys = Yaml_.read(PacMod.sh_path_keys(
|
40
|
+
cls.keys = Yaml_.read(PacMod.sh_path_keys(cls_com), cls_com.Log)
|
41
41
|
except Exception as exc:
|
42
|
-
|
42
|
+
cls_com.Log.error(exc, exc_info=True)
|
43
43
|
raise
|
44
44
|
|
45
45
|
@classmethod
|
46
|
-
def sh(cls,
|
46
|
+
def sh(cls, cls_com, **kwargs) -> Any:
|
47
47
|
if cls.sw_init:
|
48
48
|
return cls
|
49
|
-
cls.init(
|
49
|
+
cls.init(cls_com, **kwargs)
|
50
50
|
return cls
|
@@ -3,8 +3,7 @@ from typing import Any
|
|
3
3
|
|
4
4
|
from logging import Logger
|
5
5
|
|
6
|
-
from
|
7
|
-
from ka_uts_com.ioc.yaml_ import Yaml_
|
6
|
+
from ka_uts_uts.ioc.yaml_ import Yaml_
|
8
7
|
|
9
8
|
TyAny = Any
|
10
9
|
TyTimeStamp = int
|
@@ -14,22 +13,24 @@ TyDic = dict[Any, Any]
|
|
14
13
|
TyLogger = Logger
|
15
14
|
|
16
15
|
|
17
|
-
class
|
16
|
+
class Cfg:
|
18
17
|
"""Configuration Class
|
19
18
|
"""
|
20
19
|
sw_init: TyBool = False
|
21
20
|
cfg: Any = None
|
22
21
|
|
23
22
|
@classmethod
|
24
|
-
def init(cls,
|
23
|
+
def init(cls, cls_com, **kwargs) -> None:
|
25
24
|
if cls.sw_init:
|
26
25
|
return
|
27
26
|
cls.sw_init = True
|
28
|
-
|
27
|
+
_path = cls_com.sh_path_cfg_yaml()
|
28
|
+
if _path:
|
29
|
+
cls.cfg = Yaml_.read(_path, cls_com.Log)
|
29
30
|
|
30
31
|
@classmethod
|
31
|
-
def sh(cls,
|
32
|
+
def sh(cls, cls_com, **kwargs) -> Any:
|
32
33
|
if cls.sw_init:
|
33
34
|
return cls
|
34
|
-
cls.init(
|
35
|
+
cls.init(cls_com, **kwargs)
|
35
36
|
return cls.cfg
|
ka_uts_com/com.py
CHANGED
@@ -4,18 +4,18 @@ from typing import Any
|
|
4
4
|
import os
|
5
5
|
import time
|
6
6
|
import calendar
|
7
|
-
import importlib.resources as resources
|
8
|
-
import logging
|
9
|
-
import logging.config
|
10
|
-
from logging import Logger
|
11
7
|
from datetime import datetime
|
12
8
|
|
13
|
-
from
|
14
|
-
from
|
15
|
-
from
|
16
|
-
from
|
17
|
-
|
18
|
-
from ka_uts_com.
|
9
|
+
# from ka_uts_uts.utils.aoeqstmt import AoEqStmt
|
10
|
+
from ka_uts_arr.aoeqstmt import AoEqStmt
|
11
|
+
from ka_uts_uts.utils.pac import Pac
|
12
|
+
from ka_uts_uts.utils.pacmod import PacMod
|
13
|
+
|
14
|
+
from ka_uts_com.app import App
|
15
|
+
from ka_uts_com.cfg import Cfg
|
16
|
+
from ka_uts_com.exit import Exit
|
17
|
+
|
18
|
+
from ka_uts_log.log import Log
|
19
19
|
|
20
20
|
TyAny = Any
|
21
21
|
TyDateTime = datetime
|
@@ -23,7 +23,6 @@ TyTimeStamp = int
|
|
23
23
|
TyArr = list[Any]
|
24
24
|
TyBool = bool
|
25
25
|
TyDic = dict[Any, Any]
|
26
|
-
TyLogger = Logger
|
27
26
|
|
28
27
|
TnAny = None | Any
|
29
28
|
TnArr = None | TyArr
|
@@ -34,7 +33,8 @@ TnStr = None | str
|
|
34
33
|
|
35
34
|
|
36
35
|
class Com:
|
37
|
-
"""
|
36
|
+
"""
|
37
|
+
Communication Class
|
38
38
|
"""
|
39
39
|
sw_init: bool = False
|
40
40
|
dir_dat: TnStr = None
|
@@ -54,14 +54,15 @@ class Com:
|
|
54
54
|
ts_etime: TnDateTime = None
|
55
55
|
d_timer: TyDic = {}
|
56
56
|
|
57
|
-
|
58
|
-
Log =
|
57
|
+
Cfg: TnDic = None
|
58
|
+
Log: Any = None
|
59
59
|
App: Any = None
|
60
60
|
Exit: Any = None
|
61
61
|
|
62
62
|
@classmethod
|
63
|
-
def init(cls,
|
64
|
-
"""
|
63
|
+
def init(cls, cls_app, kwargs: TyDic):
|
64
|
+
"""
|
65
|
+
initialise static variables of Com class
|
65
66
|
"""
|
66
67
|
if cls.sw_init:
|
67
68
|
return
|
@@ -71,51 +72,50 @@ class Com:
|
|
71
72
|
cls.log_type = kwargs.get('log_type', 'std')
|
72
73
|
cls.cmd = kwargs.get('cmd')
|
73
74
|
cls.d_com_pacmod = PacMod.sh_d_pacmod(cls)
|
74
|
-
cls.d_app_pacmod = PacMod.sh_d_pacmod(
|
75
|
-
|
75
|
+
cls.d_app_pacmod = PacMod.sh_d_pacmod(cls_app)
|
76
76
|
cls.ts = calendar.timegm(time.gmtime())
|
77
77
|
cls.pid = os.getpid()
|
78
78
|
|
79
|
-
|
80
|
-
# print(f"Com.init cls.cmd = {cls.cmd}")
|
81
|
-
# print(f"Com.init kwargs = {kwargs}")
|
82
|
-
|
83
|
-
cls.set_path_bin()
|
84
|
-
cls.set_path_log_cfg()
|
79
|
+
cls.path_bin = cls.sh_path_bin()
|
85
80
|
|
86
|
-
cls.Log =
|
87
|
-
cls.
|
88
|
-
cls.App =
|
89
|
-
cls.Exit =
|
81
|
+
cls.Log = Log.sh(cls_app, **kwargs)
|
82
|
+
cls.Cfg = Cfg.sh(cls, **kwargs)
|
83
|
+
cls.App = App.sh(cls, **kwargs)
|
84
|
+
cls.Exit = Exit.sh(**kwargs)
|
90
85
|
|
91
86
|
@classmethod
|
92
|
-
def sh_kwargs(cls,
|
87
|
+
def sh_kwargs(cls, cls_app, d_parms, *args) -> TyDic:
|
88
|
+
"""
|
89
|
+
show keyword arguments
|
90
|
+
"""
|
93
91
|
_kwargs: TyDic = AoEqStmt.sh_d_eq(*args, d_parms=d_parms)
|
94
|
-
cls.init(
|
92
|
+
cls.init(cls_app, _kwargs)
|
95
93
|
_kwargs['com'] = cls
|
96
94
|
return _kwargs
|
97
95
|
|
98
96
|
@classmethod
|
99
|
-
def
|
100
|
-
"""
|
97
|
+
def sh_path_bin(cls) -> Any:
|
98
|
+
"""
|
99
|
+
show path to bin directory in package
|
101
100
|
"""
|
102
101
|
package = cls.d_app_pacmod['package']
|
103
|
-
path =
|
104
|
-
|
105
|
-
cls.path_bin = path
|
106
|
-
# raise ModuleNotFoundError
|
102
|
+
path = "bin"
|
103
|
+
return Pac.sh_path_by_package(package, path)
|
107
104
|
|
108
105
|
@classmethod
|
109
|
-
def
|
110
|
-
"""
|
106
|
+
def sh_path_data(cls) -> Any:
|
107
|
+
"""
|
108
|
+
show path to data directory in package
|
111
109
|
"""
|
112
110
|
package = cls.d_app_pacmod['package']
|
113
|
-
path =
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
111
|
+
path = "data"
|
112
|
+
return Pac.sh_path_by_package(package, path)
|
113
|
+
|
114
|
+
@classmethod
|
115
|
+
def sh_path_cfg_yaml(cls) -> Any:
|
116
|
+
"""
|
117
|
+
show path to configuration yaml-file in data directory of package
|
118
|
+
"""
|
119
|
+
package = cls.d_app_pacmod['package']
|
120
|
+
path = os.path.join('data', 'cfg.yml')
|
121
|
+
return Pac.sh_path_by_package(package, path)
|