xenoslib 0.1.29.17__py3-none-any.whl → 0.1.29.19__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.
- xenoslib/about.py +1 -1
- xenoslib/base.py +3 -1
- xenoslib/extend.py +5 -5
- {xenoslib-0.1.29.17.dist-info → xenoslib-0.1.29.19.dist-info}/METADATA +1 -1
- {xenoslib-0.1.29.17.dist-info → xenoslib-0.1.29.19.dist-info}/RECORD +8 -8
- {xenoslib-0.1.29.17.dist-info → xenoslib-0.1.29.19.dist-info}/WHEEL +0 -0
- {xenoslib-0.1.29.17.dist-info → xenoslib-0.1.29.19.dist-info}/licenses/LICENSE +0 -0
- {xenoslib-0.1.29.17.dist-info → xenoslib-0.1.29.19.dist-info}/top_level.txt +0 -0
xenoslib/about.py
CHANGED
xenoslib/base.py
CHANGED
|
@@ -244,7 +244,9 @@ class Singleton:
|
|
|
244
244
|
|
|
245
245
|
|
|
246
246
|
class SingletonWithArgs:
|
|
247
|
-
"""带参数的单例模式, 通过继承使用,需放到第一继承位
|
|
247
|
+
"""带参数的单例模式, 通过继承使用,需放到第一继承位
|
|
248
|
+
Please note that __init__() will still run every time
|
|
249
|
+
"""
|
|
248
250
|
|
|
249
251
|
def __new__(cls, *args, **kwargs):
|
|
250
252
|
arg = f"{args}{kwargs}"
|
xenoslib/extend.py
CHANGED
|
@@ -213,15 +213,15 @@ class ConfigLoader(SingletonWithArgs):
|
|
|
213
213
|
>>> config = ConfigLoader("config.yml", vault_secret_id="my-secret-id")
|
|
214
214
|
"""
|
|
215
215
|
|
|
216
|
+
cache = {}
|
|
217
|
+
vault_client = None
|
|
218
|
+
|
|
216
219
|
def __init__(self, config_file_path="config.yml", vault_secret_id=None):
|
|
217
220
|
"""Initialize the ConfigLoader with a configuration file and optional Vault secret."""
|
|
218
221
|
with open(config_file_path, "r") as f:
|
|
219
222
|
self._raw_config = yaml.safe_load(f) or {}
|
|
220
223
|
|
|
221
|
-
self.
|
|
222
|
-
self.vault_client = None
|
|
223
|
-
|
|
224
|
-
if vault_secret_id is not None:
|
|
224
|
+
if not self.vault_client and vault_secret_id is not None:
|
|
225
225
|
self._init_vault_client(vault_secret_id)
|
|
226
226
|
|
|
227
227
|
def _init_vault_client(self, vault_secret_id):
|
|
@@ -291,9 +291,9 @@ class ConfigLoader(SingletonWithArgs):
|
|
|
291
291
|
)
|
|
292
292
|
|
|
293
293
|
cache_key = f"{section}_{key_name}"
|
|
294
|
+
|
|
294
295
|
if use_cache and cache_key in self.cache:
|
|
295
296
|
return self.cache[cache_key]
|
|
296
|
-
|
|
297
297
|
value = self._get_value_from_vault(section, key_name)
|
|
298
298
|
self.cache[cache_key] = value
|
|
299
299
|
return value
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
xenoslib/__init__.py,sha256=vlMWwdD2gTb9ztpm_orYAm_Y0Be0Es64ifvMQwrE1jU,310
|
|
2
2
|
xenoslib/__main__.py,sha256=UpD3pl4l5ZUFxK6FzNMWRb1AZpEnwerulSFoPb_Pdgw,307
|
|
3
|
-
xenoslib/about.py,sha256=
|
|
4
|
-
xenoslib/base.py,sha256=
|
|
3
|
+
xenoslib/about.py,sha256=GUgm9KLN0JxUTqSE5BA9bKeC0ne0qluGoOrVg0EPmWI,232
|
|
4
|
+
xenoslib/base.py,sha256=rAXk71AsnWvQ7MaSad5Xxd9Lwucp-cZc15yyqoV5Dk4,12440
|
|
5
5
|
xenoslib/dev.py,sha256=R6iwKuu-xvaYiBOUyP2gpePyvXss17TOZaCmQEihPCw,1236
|
|
6
|
-
xenoslib/extend.py,sha256=
|
|
6
|
+
xenoslib/extend.py,sha256=RioMMG88w6-cKqP_pFfVrBGCGrwyUYPlM_OklxUhUyo,12485
|
|
7
7
|
xenoslib/linux.py,sha256=EFCQBq_JsmNJc3wGlJlzH9W0tjOA7sSwx0u62R5Ut2k,1318
|
|
8
8
|
xenoslib/mail.py,sha256=pkC4gpMSxKbuvNR-0CdwbJQEJNbBCp5oEYAJS-uxq9s,7286
|
|
9
9
|
xenoslib/mock.py,sha256=iNIplO7clejqLWfpY4r0WQH5BULy9dCoolDenZEci0c,3572
|
|
10
10
|
xenoslib/onedrive.py,sha256=-bJJ8Cd_RjJSlDynYqKoZlFKE1HHM34l6NXOQrWOwtg,7783
|
|
11
11
|
xenoslib/win_trayicon.py,sha256=7GJwX3c2CS1XWQjsyDK5EfM-MmEHdzPJCTX2sGpWmuU,13115
|
|
12
12
|
xenoslib/windows.py,sha256=lUTD7TowaPqYHgIL6b-GM9PLd-VyJNNGzkzC3K9vOxo,4080
|
|
13
|
-
xenoslib-0.1.29.
|
|
14
|
-
xenoslib-0.1.29.
|
|
15
|
-
xenoslib-0.1.29.
|
|
16
|
-
xenoslib-0.1.29.
|
|
17
|
-
xenoslib-0.1.29.
|
|
13
|
+
xenoslib-0.1.29.19.dist-info/licenses/LICENSE,sha256=lF6hjufhiR-xAje_Wo7ogxV5phz2d5TgkfL5SGshujg,1066
|
|
14
|
+
xenoslib-0.1.29.19.dist-info/METADATA,sha256=bo4WrG1Jxeyz-nxXPSkccZ9E2X9ZX2JK-xpBhJVpYEs,914
|
|
15
|
+
xenoslib-0.1.29.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
+
xenoslib-0.1.29.19.dist-info/top_level.txt,sha256=Rfm4GdW0NyA2AHDNUF2wFQOfAo53mAPibddSHGd3X60,9
|
|
17
|
+
xenoslib-0.1.29.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|