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.
Files changed (46) hide show
  1. build/lib/dist/ka_uts_com-2.0.0.250407-py3-none-any.whl +0 -0
  2. build/lib/dist/ka_uts_com-2.0.0.250407.tar.gz +0 -0
  3. build/lib/ka_uts_com/__version__.py +1 -1
  4. build/lib/ka_uts_com/base/app_.py +10 -11
  5. build/lib/ka_uts_com/base/cfg_.py +14 -5
  6. build/lib/ka_uts_com/base/log_.py +66 -50
  7. build/lib/ka_uts_com/com.py +54 -11
  8. build/lib/ka_uts_com/data/log.std.yml +47 -26
  9. build/lib/ka_uts_com/data/log.usr.yml +46 -25
  10. build/lib/ka_uts_com/ioc/jinja2_.py +1 -1
  11. build/lib/ka_uts_com/ioc/yaml_.py +2 -1
  12. build/lib/ka_uts_com/log.py +23 -12
  13. build/lib/ka_uts_com/timer.py +10 -6
  14. build/lib/ka_uts_com/utils/aoeqstmt.py +0 -2
  15. build/lib/ka_uts_com/utils/doeq.py +7 -7
  16. build/lib/ka_uts_com/utils/pac.py +35 -0
  17. build/lib/ka_uts_com/utils/pacmod.py +74 -72
  18. dist/ka_uts_com-2.0.0.250407-py3-none-any.whl +0 -0
  19. dist/ka_uts_com-2.0.0.250407.tar.gz +0 -0
  20. ka_uts_com/__version__.py +1 -1
  21. ka_uts_com/base/app_.py +10 -11
  22. ka_uts_com/base/cfg_.py +14 -5
  23. ka_uts_com/base/log_.py +66 -50
  24. ka_uts_com/com.py +54 -11
  25. ka_uts_com/data/log.std.yml +47 -26
  26. ka_uts_com/data/log.usr.yml +46 -25
  27. ka_uts_com/ioc/jinja2_.py +1 -1
  28. ka_uts_com/ioc/yaml_.py +2 -1
  29. ka_uts_com/log.py +23 -12
  30. ka_uts_com/timer.py +10 -6
  31. ka_uts_com/utils/aoeqstmt.py +0 -2
  32. ka_uts_com/utils/doeq.py +7 -7
  33. ka_uts_com/utils/pac.py +35 -0
  34. ka_uts_com/utils/pacmod.py +74 -72
  35. {ka_uts_com-1.0.1.250131.dist-info → ka_uts_com-2.1.0.250408.dist-info}/METADATA +389 -406
  36. ka_uts_com-2.1.0.250408.dist-info/RECORD +55 -0
  37. {ka_uts_com-1.0.1.250131.dist-info → ka_uts_com-2.1.0.250408.dist-info}/licenses/LICENSE.txt +1 -2
  38. build/lib/dist/ka_uts_com-1.0.1.250131-py3-none-any.whl +0 -0
  39. build/lib/dist/ka_uts_com-1.0.1.250131.tar.gz +0 -0
  40. build/lib/ka_uts_com/utils/py.typed +0 -0
  41. dist/ka_uts_com-1.0.1.250131-py3-none-any.whl +0 -0
  42. dist/ka_uts_com-1.0.1.250131.tar.gz +0 -0
  43. ka_uts_com/utils/py.typed +0 -0
  44. ka_uts_com-1.0.1.250131.dist-info/RECORD +0 -55
  45. {ka_uts_com-1.0.1.250131.dist-info → ka_uts_com-2.1.0.250408.dist-info}/WHEEL +0 -0
  46. {ka_uts_com-1.0.1.250131.dist-info → ka_uts_com-2.1.0.250408.dist-info}/top_level.txt +0 -0
@@ -2,106 +2,108 @@
2
2
  from typing import Any
3
3
 
4
4
  from os import path as os_path
5
- import pkg_resources
5
+
6
+ from ka_uts_com.utils.pac import Pac
6
7
 
7
8
  TyArr = list[Any]
8
9
  TyDic = dict[Any, Any]
9
- TnDic = None | TyDic
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(root_cls, tenant: Any) -> TyDic:
17
+ def sh_d_pacmod(cls) -> TyDic:
17
18
  """ Show Pacmod Dictionary
18
19
  """
19
- a_pacmod: TyArr = root_cls.__module__.split(".")
20
- package = a_pacmod[0]
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 sh_path_cfg_yaml(d_pacmod: TyDic) -> str:
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
- directory: str = f"{package}.data"
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 sh_path_keys_yaml(
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
- directory = f"{package}.data"
54
- path: str = pkg_resources.resource_filename(directory, filename)
55
- return path
37
+ path = 'data/keys.yml'
38
+ return Pac.sh_path_by_package(package, path)
56
39
 
57
- @staticmethod
58
- def sh_pacmod_type(d_pacmod: TyDic, type_: str) -> str:
59
- """ show Data File Path
60
- """
61
- package = d_pacmod['package']
62
- module = d_pacmod['module']
63
- return f"/data/{package}/{module}/{type_}"
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
- @classmethod
66
- def sh_file_path(
67
- cls, d_pacmod: TyDic, type_: str, suffix: str,
68
- pid: Any, ts: Any, **kwargs) -> str:
69
- """ show type specific path
70
- """
71
- filename = kwargs.get('filename')
72
- if filename is not None:
73
- filename_ = filename
74
- else:
75
- filename_ = type_
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
- sw_run_pid_ts = kwargs.get('sw_run_pid_ts', True)
78
- if sw_run_pid_ts is None:
79
- sw_run_pid_ts = True
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
- _dir: str = cls.sh_pacmod_type(d_pacmod, type_)
82
- if sw_run_pid_ts:
83
- file_path = os_path.join(
84
- _dir, f"{filename_}_{pid}_{ts}.{suffix}")
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
- file_path = os_path.join(_dir, f"{filename_}.{suffix}")
87
- return file_path
101
+ return f"{dir_dat}/{package}/{module}/{type_}"
88
102
 
89
103
  @classmethod
90
- def sh_pattern(
91
- cls, d_pacmod: TyDic, type_: str, suffix: str, **kwargs) -> str:
104
+ def sh_path_pattern(
105
+ cls, com, filename, type_: str, suffix: str) -> TyPath:
92
106
  """ show type specific path
93
107
  """
94
- filename = kwargs.get('filename')
95
- _directory: str = cls.sh_pacmod_type(d_pacmod, type_)
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}")