ezKit 1.7.4__tar.gz → 1.7.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezKit
3
- Version: 1.7.4
3
+ Version: 1.7.6
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -793,36 +793,71 @@ def filesize(
793
793
  # --------------------------------------------------------------------------------------------------
794
794
 
795
795
 
796
- def resolve_path() -> str | None:
797
- """resolve path"""
798
- # 获取当前目录名称
799
- return str(Path().resolve())
796
+ # def resolve_path() -> str | None:
797
+ # """resolve path"""
798
+ # # 获取当前目录名称
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 realpath(
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(debug, bool):
824
+ # logger.info(f"path: {path}")
825
+ # return os.path.realpath(path, **kwargs)
826
+ if v_true(path, str, debug=debug) is False:
827
+ return None
828
+ return str(Path(path, **kwargs).resolve())
810
829
  except Exception as e:
811
830
  if v_true(debug, bool):
812
831
  logger.exception(e)
813
832
  return None
814
833
 
815
834
 
816
- def real_path(
835
+ def current_dir(
817
836
  path: str,
818
837
  debug: bool = False,
819
838
  **kwargs
820
839
  ) -> str | None:
821
- """获取真实路径"""
840
+ """获取对象所在目录"""
822
841
  try:
842
+ if v_true(path, str, debug=debug) is False:
843
+ return None
844
+ return str(Path(path, **kwargs).parent.resolve())
845
+ except Exception as e:
823
846
  if v_true(debug, bool):
824
- logger.info(f"path: {path}")
825
- return os.path.realpath(path, **kwargs)
847
+ logger.exception(e)
848
+ return None
849
+
850
+
851
+ def parent_dir(
852
+ path: str,
853
+ debug: bool = False,
854
+ **kwargs
855
+ ) -> str | None:
856
+ """获取对象所在目录的父目录"""
857
+ try:
858
+ if v_true(path, str, debug=debug) is False:
859
+ return None
860
+ return str(Path(path, **kwargs).parent.parent.resolve())
826
861
  except Exception as e:
827
862
  if v_true(debug, bool):
828
863
  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.6
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
3
3
 
4
4
  setup(
5
5
  name='ezKit',
6
- version='1.7.4',
6
+ version='1.7.6',
7
7
  author='septvean',
8
8
  author_email='septvean@gmail.com',
9
9
  description='Easy Kit',
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
File without changes