ezKit 2.0.22__tar.gz → 2.0.23__tar.gz
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.
- {ezkit-2.0.22/ezKit.egg-info → ezkit-2.0.23}/PKG-INFO +1 -1
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/utils.py +43 -0
- {ezkit-2.0.22 → ezkit-2.0.23/ezKit.egg-info}/PKG-INFO +1 -1
- {ezkit-2.0.22 → ezkit-2.0.23}/setup.py +1 -1
- {ezkit-2.0.22 → ezkit-2.0.23}/LICENSE +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/MANIFEST.in +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/README.md +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/__init__.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/__zabbix.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/asyncdatabase.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/cipher.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/database.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/errorcode.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/fastapix.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/http.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/redix.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/sendemail.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit/stock.py +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit.egg-info/SOURCES.txt +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit.egg-info/dependency_links.txt +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit.egg-info/requires.txt +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/ezKit.egg-info/top_level.txt +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/pyproject.toml +0 -0
- {ezkit-2.0.22 → ezkit-2.0.23}/setup.cfg +0 -0
|
@@ -437,3 +437,46 @@ def check_file_type(file_object: str, file_type: str) -> bool:
|
|
|
437
437
|
logger.error(e)
|
|
438
438
|
|
|
439
439
|
return False
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
# --------------------------------------------------------------------------------------------------
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
def resolve_path(
|
|
446
|
+
path: str,
|
|
447
|
+
*,
|
|
448
|
+
parents: int = 0,
|
|
449
|
+
**kwargs,
|
|
450
|
+
) -> str | None:
|
|
451
|
+
"""
|
|
452
|
+
获取路径的真实路径或其父目录
|
|
453
|
+
|
|
454
|
+
:param path: 原始路径
|
|
455
|
+
:param parents: 向上取多少层父目录
|
|
456
|
+
0 = 当前路径
|
|
457
|
+
1 = 所在目录
|
|
458
|
+
2 = 父目录的父目录
|
|
459
|
+
"""
|
|
460
|
+
try:
|
|
461
|
+
|
|
462
|
+
if not isTrue(path, str):
|
|
463
|
+
return None
|
|
464
|
+
|
|
465
|
+
p = Path(path, **kwargs)
|
|
466
|
+
|
|
467
|
+
for _ in range(parents):
|
|
468
|
+
p = p.parent
|
|
469
|
+
|
|
470
|
+
return str(p.resolve())
|
|
471
|
+
|
|
472
|
+
except Exception as e:
|
|
473
|
+
|
|
474
|
+
if DEBUG:
|
|
475
|
+
logger.exception(e)
|
|
476
|
+
else:
|
|
477
|
+
logger.error(e)
|
|
478
|
+
|
|
479
|
+
return None
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
# --------------------------------------------------------------------------------------------------
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|