xlin 0.1.14__tar.gz → 0.1.15__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
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.1
2
2
  Name: xlin
3
- Version: 0.1.14
3
+ Version: 0.1.15
4
4
  Summary: toolbox for LinXueyuan
5
5
  License: MIT
6
6
  Author: XiChen
@@ -18,7 +18,6 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Programming Language :: Python :: 3.13
22
21
  Requires-Dist: loguru
23
22
  Requires-Dist: pandas
24
23
  Requires-Dist: pyexcel
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "xlin"
3
- version = "0.1.14"
3
+ version = "0.1.15"
4
4
  description = "toolbox for LinXueyuan"
5
5
  authors = ["XiChen <23211526+LinXueyuanStdio@users.noreply.github.com>"]
6
6
  license = "MIT"
@@ -103,32 +103,12 @@ def rm(dir_path: Union[str, Path, List[str], List[Path]], filter: Callable[[Path
103
103
  filenames = os.listdir(dir_path)
104
104
  for filename in sorted(filenames):
105
105
  filepath = dir_path / filename
106
- if debug:
107
- print("checking", filepath)
108
- if filepath.is_dir():
109
- paths = ls(filepath, filter, expand_all_subdir)
110
- if len(paths) > 0:
111
- rm(paths, filter, expand_all_subdir)
112
- child = filepath
113
- while child.exists() and len(os.listdir(child)) > 0:
114
- child = child / os.listdir(child)[0]
115
- while child != filepath:
116
- if child.exists() and len(os.listdir(child)) == 0:
117
- child.rmdir()
118
- if debug:
119
- print(f"删除空文件夹 {child}")
120
- else:
121
- break
122
- if filepath.exists() and len(os.listdir(filepath)) == 0:
123
- filepath.rmdir()
124
- if debug:
125
- print(f"删除空文件夹 {filepath}")
126
- elif filter(filepath):
127
- rm(filepath, filter, expand_all_subdir)
128
- if dir_path.exists() and len(os.listdir(dir_path)) == 0:
129
- dir_path.rmdir()
130
- if debug:
131
- print(f"删除空文件夹 {dir_path}")
106
+ rm(filepath, filter, expand_all_subdir, debug)
107
+ if dir_path.exists() and dir_path.is_dir() and len(os.listdir(dir_path)) == 0:
108
+ if filter(dir_path):
109
+ dir_path.rmdir()
110
+ if debug:
111
+ print(f"删除空文件夹 {dir_path}")
132
112
 
133
113
 
134
114
  def cp(
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