ka-uts-com 1.0.1.250131__py3-none-any.whl → 2.1.0.250408__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.
- build/lib/dist/ka_uts_com-2.0.0.250407-py3-none-any.whl +0 -0
- build/lib/dist/ka_uts_com-2.0.0.250407.tar.gz +0 -0
- build/lib/ka_uts_com/__version__.py +1 -1
- build/lib/ka_uts_com/base/app_.py +10 -11
- build/lib/ka_uts_com/base/cfg_.py +14 -5
- build/lib/ka_uts_com/base/log_.py +66 -50
- build/lib/ka_uts_com/com.py +54 -11
- build/lib/ka_uts_com/data/log.std.yml +47 -26
- build/lib/ka_uts_com/data/log.usr.yml +46 -25
- build/lib/ka_uts_com/ioc/jinja2_.py +1 -1
- build/lib/ka_uts_com/ioc/yaml_.py +2 -1
- build/lib/ka_uts_com/log.py +23 -12
- build/lib/ka_uts_com/timer.py +10 -6
- build/lib/ka_uts_com/utils/aoeqstmt.py +0 -2
- build/lib/ka_uts_com/utils/doeq.py +7 -7
- build/lib/ka_uts_com/utils/pac.py +35 -0
- build/lib/ka_uts_com/utils/pacmod.py +74 -72
- dist/ka_uts_com-2.0.0.250407-py3-none-any.whl +0 -0
- dist/ka_uts_com-2.0.0.250407.tar.gz +0 -0
- ka_uts_com/__version__.py +1 -1
- ka_uts_com/base/app_.py +10 -11
- ka_uts_com/base/cfg_.py +14 -5
- ka_uts_com/base/log_.py +66 -50
- ka_uts_com/com.py +54 -11
- ka_uts_com/data/log.std.yml +47 -26
- ka_uts_com/data/log.usr.yml +46 -25
- ka_uts_com/ioc/jinja2_.py +1 -1
- ka_uts_com/ioc/yaml_.py +2 -1
- ka_uts_com/log.py +23 -12
- ka_uts_com/timer.py +10 -6
- ka_uts_com/utils/aoeqstmt.py +0 -2
- ka_uts_com/utils/doeq.py +7 -7
- ka_uts_com/utils/pac.py +35 -0
- ka_uts_com/utils/pacmod.py +74 -72
- {ka_uts_com-1.0.1.250131.dist-info → ka_uts_com-2.1.0.250408.dist-info}/METADATA +389 -406
- ka_uts_com-2.1.0.250408.dist-info/RECORD +55 -0
- {ka_uts_com-1.0.1.250131.dist-info → ka_uts_com-2.1.0.250408.dist-info}/licenses/LICENSE.txt +1 -2
- build/lib/dist/ka_uts_com-1.0.1.250131-py3-none-any.whl +0 -0
- build/lib/dist/ka_uts_com-1.0.1.250131.tar.gz +0 -0
- build/lib/ka_uts_com/utils/py.typed +0 -0
- dist/ka_uts_com-1.0.1.250131-py3-none-any.whl +0 -0
- dist/ka_uts_com-1.0.1.250131.tar.gz +0 -0
- ka_uts_com/utils/py.typed +0 -0
- ka_uts_com-1.0.1.250131.dist-info/RECORD +0 -55
- {ka_uts_com-1.0.1.250131.dist-info → ka_uts_com-2.1.0.250408.dist-info}/WHEEL +0 -0
- {ka_uts_com-1.0.1.250131.dist-info → ka_uts_com-2.1.0.250408.dist-info}/top_level.txt +0 -0
ka_uts_com/utils/pacmod.py
CHANGED
@@ -2,106 +2,108 @@
|
|
2
2
|
from typing import Any
|
3
3
|
|
4
4
|
from os import path as os_path
|
5
|
-
|
5
|
+
|
6
|
+
from ka_uts_com.utils.pac import Pac
|
6
7
|
|
7
8
|
TyArr = list[Any]
|
8
9
|
TyDic = dict[Any, Any]
|
9
|
-
|
10
|
+
TyPath = str
|
10
11
|
|
11
12
|
|
12
13
|
class PacMod:
|
13
14
|
""" Package Module Management
|
14
15
|
"""
|
15
16
|
@staticmethod
|
16
|
-
def sh_d_pacmod(
|
17
|
+
def sh_d_pacmod(cls) -> TyDic:
|
17
18
|
""" Show Pacmod Dictionary
|
18
19
|
"""
|
19
|
-
a_pacmod: TyArr =
|
20
|
-
package
|
21
|
-
module = a_pacmod[1]
|
22
|
-
d_pacmod: TyDic = {}
|
23
|
-
d_pacmod['tenant'] = tenant
|
24
|
-
d_pacmod['package'] = package
|
25
|
-
d_pacmod['module'] = module
|
26
|
-
return d_pacmod
|
20
|
+
a_pacmod: TyArr = cls.__module__.split(".")
|
21
|
+
return {'package': a_pacmod[0], 'module': a_pacmod[1]}
|
27
22
|
|
28
|
-
# class Cfg:
|
29
|
-
# """ Configuration Sub Class of Package Module Class
|
30
|
-
# """
|
31
23
|
@staticmethod
|
32
|
-
def
|
24
|
+
def sh_path_module_yaml(d_pacmod: TyDic) -> Any:
|
33
25
|
""" show directory
|
34
26
|
"""
|
35
27
|
package = d_pacmod['package']
|
36
28
|
module = d_pacmod['module']
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
# print(f"dir = {dir}")
|
41
|
-
# print(f"package = {package}")
|
42
|
-
# print(f"module = {module}")
|
43
|
-
|
44
|
-
path: str = pkg_resources.resource_filename(directory, f"{module}.yml")
|
45
|
-
return path
|
29
|
+
path = f"{module}/data/{module}.yml"
|
30
|
+
return Pac.sh_path_by_package(package, path)
|
46
31
|
|
47
32
|
@staticmethod
|
48
|
-
def
|
49
|
-
d_pacmod: TyDic, filename: str = 'keys.yml') -> str:
|
33
|
+
def sh_path_keys(d_pacmod: TyDic) -> Any:
|
50
34
|
""" show directory
|
51
35
|
"""
|
52
36
|
package = d_pacmod['package']
|
53
|
-
|
54
|
-
|
55
|
-
return path
|
37
|
+
path = 'data/keys.yml'
|
38
|
+
return Pac.sh_path_by_package(package, path)
|
56
39
|
|
57
|
-
@staticmethod
|
58
|
-
def
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
40
|
+
# @staticmethod
|
41
|
+
# def sh_path_log_cfg(com) -> TyPath:
|
42
|
+
# """ show directory
|
43
|
+
# """
|
44
|
+
# package = com.d_app_pacmod['package']
|
45
|
+
# path = resources.files(package).joinpath(f"data/log.{com.log_type}.yml")
|
46
|
+
# if path.is_file():
|
47
|
+
# return path
|
48
|
+
# package = com.d_com_pacmod['package']
|
49
|
+
# path = resources.files(package).joinpath(f"data/log.{com.log_type}.yml")
|
50
|
+
# if path.is_file():
|
51
|
+
# return path
|
52
|
+
# raise ModuleNotFoundError
|
64
53
|
|
65
|
-
@
|
66
|
-
def
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
54
|
+
# @staticmethod
|
55
|
+
# def sh_path_cfg(d_pacmod: TyDic) -> Any:
|
56
|
+
# """ show directory
|
57
|
+
# """
|
58
|
+
# package = com.d_app_pacmod['package']
|
59
|
+
# path = 'dat/cfg.yml'
|
60
|
+
# return Pac.sh_path(package, path)
|
61
|
+
|
62
|
+
# @staticmethod
|
63
|
+
# def sh_path_type(d_pacmod: TyDic, type_: str) -> str:
|
64
|
+
# """ show Data File Path
|
65
|
+
# """
|
66
|
+
# # def sh_pacmod_type(d_pacmod: TyDic, type_: str) -> str:
|
67
|
+
# package = d_pacmod['package']
|
68
|
+
# module = d_pacmod['module']
|
69
|
+
# return f"/data/{package}/{module}/{type_}"
|
76
70
|
|
77
|
-
|
78
|
-
|
79
|
-
|
71
|
+
# @classmethod
|
72
|
+
# def sh_file_path(
|
73
|
+
# cls, d_pacmod: TyDic, type_: str, suffix: str,
|
74
|
+
# pid: Any, ts: Any, **kwargs) -> str:
|
75
|
+
# """ show type specific path
|
76
|
+
# """
|
77
|
+
# filename_ = kwargs.get('filename', type_)
|
78
|
+
# sw_run_pid_ts = kwargs.get('sw_run_pid_ts', True)
|
79
|
+
# if sw_run_pid_ts is None:
|
80
|
+
# sw_run_pid_ts = True
|
81
|
+
#
|
82
|
+
# _dir: str = cls.sh_pacmod_type(d_pacmod, type_)
|
83
|
+
# if sw_run_pid_ts:
|
84
|
+
# file_path = os_path.join(
|
85
|
+
# _dir, f"{filename_}_{pid}_{ts}.{suffix}")
|
86
|
+
# else:
|
87
|
+
# file_path = os_path.join(_dir, f"{filename_}.{suffix}")
|
88
|
+
# return file_path
|
80
89
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
90
|
+
@staticmethod
|
91
|
+
def sh_dir_type(com, type_: str) -> TyPath:
|
92
|
+
"""Show run_dir
|
93
|
+
"""
|
94
|
+
dir_dat: str = com.dir_dat
|
95
|
+
tenant: str = com.tenant
|
96
|
+
package: str = com.d_app_pacmod['package']
|
97
|
+
module: str = com.d_app_pacmod['module']
|
98
|
+
if not tenant:
|
99
|
+
return f"{dir_dat}/{tenant}/{package}/{module}/{type_}"
|
85
100
|
else:
|
86
|
-
|
87
|
-
return file_path
|
101
|
+
return f"{dir_dat}/{package}/{module}/{type_}"
|
88
102
|
|
89
103
|
@classmethod
|
90
|
-
def
|
91
|
-
cls,
|
104
|
+
def sh_path_pattern(
|
105
|
+
cls, com, filename, type_: str, suffix: str) -> TyPath:
|
92
106
|
""" show type specific path
|
93
107
|
"""
|
94
|
-
|
95
|
-
|
96
|
-
path = os_path.join(_directory, f"{filename}*.{suffix}")
|
97
|
-
return path
|
98
|
-
|
99
|
-
@staticmethod
|
100
|
-
def sh_path_cfg_log(d_pacmod: TnDic = None, filename: str = 'log.yml'):
|
101
|
-
""" show directory
|
102
|
-
"""
|
103
|
-
if d_pacmod is None:
|
104
|
-
d_pacmod = {'package': 'ka_uts_com', 'module': 'com'}
|
105
|
-
return pkg_resources.resource_filename(
|
106
|
-
f"{d_pacmod['package']}.data", filename
|
107
|
-
)
|
108
|
+
_dir: str = cls.sh_dir_type(com, type_)
|
109
|
+
return os_path.join(_dir, f"{filename}*.{suffix}")
|