rkt-config-lib 1.3.0__py3-none-any.whl → 1.4.0__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.
@@ -1,9 +1,15 @@
1
1
  import os
2
2
  import yaml
3
3
 
4
- from rkt_lib_toolkit.tool.Tool import Tool, Singleton
4
+ try:
5
+ from rkt_logger_lib.Logger import Logger
6
+ except ImportError:
7
+ from rkt_lib_toolkit.rkt_logger_lib.Logger import Logger
5
8
 
6
- from rkt_lib_toolkit.logger.Logger import Logger
9
+ try:
10
+ from rkt_tool_lib.Tool import Tool, Singleton
11
+ except ImportError:
12
+ from rkt_lib_toolkit.rkt_tool_lib.Tool import Tool, Singleton
7
13
 
8
14
 
9
15
  class Config(metaclass=Singleton):
@@ -21,14 +27,14 @@ class Config(metaclass=Singleton):
21
27
  self._tool = Tool()
22
28
  self.data = {}
23
29
 
24
- def get_data(self, needed_file: str = "", config_dir: str = "config", create_if_not_exist: bool = False) -> None:
30
+ def get_data(self, needed_file: str = "", _config_dir: str = "config", create_if_not_exist: bool = False) -> None:
25
31
  """
26
32
  Load all file in 'config_dir' and get data in dict formatted as : {"basename_1": <VALUE_1>, ...}
27
33
  """
28
- config_dir = self._tool.get_dir(config_dir)
34
+ config_dir = self._tool.get_dir(_config_dir)
29
35
 
30
- if create_if_not_exist and not os.path.exists(config_dir):
31
- os.makedirs(config_dir, exist_ok=True)
36
+ if (not config_dir or not os.path.exists(config_dir)) and create_if_not_exist:
37
+ os.makedirs(_config_dir, exist_ok=True)
32
38
 
33
39
  if needed_file:
34
40
  filename = os.path.basename(needed_file).split(".")[0]
@@ -1,12 +1,9 @@
1
- Metadata-Version: 2.1
2
- Name: rkt-config-lib
3
- Version: 1.3.0
1
+ Metadata-Version: 2.2
2
+ Name: rkt_config_lib
3
+ Version: 1.4.0
4
4
  Summary: RootKit custom PyYaml Lib
5
- Home-page: UNKNOWN
6
5
  Author: RootKit
7
6
  Author-email: rootkit@rootkit-lab.org
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
7
  Classifier: Development Status :: 5 - Production/Stable
11
8
  Classifier: Intended Audience :: Developers
12
9
  Classifier: Intended Audience :: End Users/Desktop
@@ -21,8 +18,16 @@ Requires-Python: >=3.7
21
18
  Description-Content-Type: text/markdown
22
19
  License-File: LICENSE
23
20
  Requires-Dist: PyYaml
24
- Requires-Dist: rkt-tool-lib
25
- Requires-Dist: rkt-logger-lib
21
+ Requires-Dist: rkt_tool_lib
22
+ Requires-Dist: rkt_logger_lib
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
26
31
 
27
32
  # rkt_config_lib - Python library
28
33
 
@@ -97,5 +102,3 @@ If you find this library useful here's how you can help:
97
102
  - Send a merge request with your kickass new features and bug fixes
98
103
  - Help new users with [issues](https://gitlab.tprc.ovh/python/rkt_lib_toolkit/-/issues) they may encounter
99
104
  - Support the development of this library and star this repo!
100
-
101
-
@@ -0,0 +1,7 @@
1
+ rkt_config_lib/Config.py,sha256=ypDnZEWDrl8wOFn1yfXjTOvw3OV6Lz4k4KzVxTOWYks,2098
2
+ rkt_config_lib/__init__.py,sha256=dgAqGP8sTB2ZsUt6k9MYpd3Kscb8fgZKVF_V-UCD7b4,27
3
+ rkt_config_lib-1.4.0.dist-info/LICENSE,sha256=cJOcDuuCS3-_wqJQeJzXupPQBeTXBxQR858ECRPkXkw,1097
4
+ rkt_config_lib-1.4.0.dist-info/METADATA,sha256=nPDKhDkAbFda8zOnLsnTZVqGH1Z39VkbERjoRMNoV34,4550
5
+ rkt_config_lib-1.4.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
6
+ rkt_config_lib-1.4.0.dist-info/top_level.txt,sha256=gVNNYSVkxR-HO_zOynapeEAmZpco7DioxliVdgpMRfU,15
7
+ rkt_config_lib-1.4.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1 @@
1
+ rkt_config_lib
@@ -1,7 +0,0 @@
1
- config/Config.py,sha256=_Aq0zd-5kihpHMDDVFq75kdxf6Zr0sfaFzbhY3-9C74,1906
2
- config/__init__.py,sha256=dgAqGP8sTB2ZsUt6k9MYpd3Kscb8fgZKVF_V-UCD7b4,27
3
- rkt_config_lib-1.3.0.dist-info/LICENSE,sha256=cJOcDuuCS3-_wqJQeJzXupPQBeTXBxQR858ECRPkXkw,1097
4
- rkt_config_lib-1.3.0.dist-info/METADATA,sha256=bAz2UnVYLq4wzfrt9NJqqcrMDgJyHaloVSl_77QoFhs,4428
5
- rkt_config_lib-1.3.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
6
- rkt_config_lib-1.3.0.dist-info/top_level.txt,sha256=9hK4m828QBN59kTX5IVy40cPd9zUw5QWQF2AlSrXCJ4,7
7
- rkt_config_lib-1.3.0.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- config
File without changes