ezKit 1.7.4__py3-none-any.whl → 1.7.5__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.
ezKit/utils.py CHANGED
@@ -799,14 +799,46 @@ def resolve_path() -> str | None:
799
799
  return str(Path().resolve())
800
800
 
801
801
 
802
- def parent_path(
802
+ # def parent_path(
803
+ # path: str,
804
+ # debug: bool = False,
805
+ # **kwargs
806
+ # ) -> str | None:
807
+ # """获取父目录名称"""
808
+ # try:
809
+ # return str(Path(path, **kwargs).parent.resolve()) if v_true(path, str, debug=debug) else None
810
+ # except Exception as e:
811
+ # if v_true(debug, bool):
812
+ # logger.exception(e)
813
+ # return None
814
+
815
+
816
+ def current_dir(
803
817
  path: str,
804
818
  debug: bool = False,
805
819
  **kwargs
806
820
  ) -> str | None:
807
- """获取父目录名称"""
821
+ """获取当前文件所在目录"""
808
822
  try:
809
- return str(Path(path, **kwargs).parent.resolve()) if v_true(path, str, debug=debug) else None
823
+ if v_true(path, str, debug=debug) is False:
824
+ return None
825
+ return str(Path(path, **kwargs).parent.resolve())
826
+ except Exception as e:
827
+ if v_true(debug, bool):
828
+ logger.exception(e)
829
+ return None
830
+
831
+
832
+ def parent_dir(
833
+ path: str,
834
+ debug: bool = False,
835
+ **kwargs
836
+ ) -> str | None:
837
+ """获取当前文件所在目录的父目录"""
838
+ try:
839
+ if v_true(path, str, debug=debug) is False:
840
+ return None
841
+ return str(Path(path, **kwargs).parent.parent.resolve())
810
842
  except Exception as e:
811
843
  if v_true(debug, bool):
812
844
  logger.exception(e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezKit
3
- Version: 1.7.4
3
+ Version: 1.7.5
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -12,11 +12,11 @@ ezKit/redis.py,sha256=pY4SPlcgQ7S8IeY2xoDpxy-xCZxzZQrQJNAoWRsC1dI,1773
12
12
  ezKit/reports.py,sha256=dBBggggCCLuk5YD6SjdUPuxTr3wiJojP3lA7dQfg6Pk,8898
13
13
  ezKit/sendemail.py,sha256=AAdxBvEYN_AJVvBkSAvXzhXC5jkbRsD_8P51h2SdTRw,8413
14
14
  ezKit/token.py,sha256=4L6A26KsxvB4WfF8R7SYiBmihJK0PiN5Oh7dgDVJtxU,1382
15
- ezKit/utils.py,sha256=W8RqgNvN9VIhqaD0vuMZkXwISEuVh6_L95P2YyJ-TR0,47806
15
+ ezKit/utils.py,sha256=rTTQwcgMmYwi-TFBwdr4FiawVuOss59DX1mKdmHDM1M,48616
16
16
  ezKit/xftp.py,sha256=qbCqFcGe22TDBSisj0Zoz78tnydDWoOfvywWpXdfaGw,6982
17
17
  ezKit/zabbix.py,sha256=soM5UEeYMfm7NczbPOVLirmHm3G20dECQ0aCBttZfhQ,28350
18
- ezKit-1.7.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
19
- ezKit-1.7.4.dist-info/METADATA,sha256=7AeW0LIvB6RBv2nDDuzCkTU13GJUW_Pqcqg6pSxJxio,163
20
- ezKit-1.7.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
21
- ezKit-1.7.4.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
22
- ezKit-1.7.4.dist-info/RECORD,,
18
+ ezKit-1.7.5.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
19
+ ezKit-1.7.5.dist-info/METADATA,sha256=hWIBqepDZAuS_xHuQt0C9B5_AbvibiqqUWjW_4icDR0,163
20
+ ezKit-1.7.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
21
+ ezKit-1.7.5.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
22
+ ezKit-1.7.5.dist-info/RECORD,,
File without changes
File without changes