byzh-core 0.0.9.9__tar.gz → 0.0.9.11__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.
Files changed (33) hide show
  1. {byzh_core-0.0.9.9/byzh_core.egg-info → byzh_core-0.0.9.11}/PKG-INFO +1 -1
  2. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/B_os.py +33 -1
  3. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bterminal/cmd.py +2 -0
  4. byzh_core-0.0.9.11/byzh/core/__main__.py +17 -0
  5. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11/byzh_core.egg-info}/PKG-INFO +1 -1
  6. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/entry_points.txt +1 -0
  7. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/setup.py +2 -1
  8. byzh_core-0.0.9.9/byzh/core/__main__.py +0 -9
  9. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/LICENSE +0 -0
  10. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/README.md +0 -0
  11. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Barchive/__init__.py +0 -0
  12. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Barchive/archive.py +0 -0
  13. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Brecorder/__init__.py +0 -0
  14. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Brecorder/record1d.py +0 -0
  15. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Brecorder/record2d.py +0 -0
  16. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Btable/__init__.py +0 -0
  17. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Btable/auto_table.py +0 -0
  18. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bterminal/__init__.py +0 -0
  19. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bterminal/run_func.py +0 -0
  20. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Btqdm/__init__.py +0 -0
  21. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Btqdm/my_tqdm.py +0 -0
  22. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Butils/__init__.py +0 -0
  23. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Butils/decorator.py +0 -0
  24. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Butils/text_style.py +0 -0
  25. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Butils/timer.py +0 -0
  26. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bwriter/__init__.py +0 -0
  27. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bwriter/writer.py +0 -0
  28. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/__init__.py +0 -0
  29. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/SOURCES.txt +0 -0
  30. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/dependency_links.txt +0 -0
  31. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/requires.txt +0 -0
  32. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/top_level.txt +0 -0
  33. {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: byzh-core
3
- Version: 0.0.9.9
3
+ Version: 0.0.9.11
4
4
  Summary: byzh-core是byzh系列的核心库,包含了一些常用的工具函数和类。
5
5
  Author: byzh_rc
6
6
  License: MIT
@@ -151,7 +151,39 @@ def walk(
151
151
  new_path = os.path.join(root, dirname)
152
152
  yield from walk(new_path, black_dirnames, black_filenames, black_stems, black_exts)
153
153
 
154
+
155
+ def dir_tree(path: Path, show_root=True, verbose=True, prefix=""):
156
+ '''
157
+ 显示目录树
158
+ '''
159
+ path = Path(path)
160
+
161
+ result = ""
162
+ if show_root:
163
+ root_name = path.resolve().name
164
+ result += root_name + "\n"
165
+ prefix += "" # 根目录本身不需要额外缩进
166
+
167
+ entries = sorted(path.iterdir(), key=lambda x: (x.is_file(), x.name.lower()))
168
+ for i, entry in enumerate(entries):
169
+ connector = "└── " if i == len(entries) - 1 else "├── "
170
+ result += prefix + connector + entry.name + "\n"
171
+ if entry.is_dir():
172
+ extension = " " if i == len(entries) - 1 else "│ "
173
+ result += dir_tree(
174
+ entry,
175
+ show_root=False, # 子目录不显示自己
176
+ verbose=False, # 子目录不打印自己
177
+ prefix=prefix + extension,
178
+ )
179
+
180
+ if verbose:
181
+ print(result)
182
+
183
+ return result
184
+
185
+
154
186
  if __name__ == '__main__':
155
187
  # print(get_dirpaths_in_dir(r'E:\byzh_workingplace\byzh-rc-to-pypi'))
156
188
  a = get_filepaths_in_dir(r'/')
157
- print(a)
189
+ print(a)
@@ -2,6 +2,7 @@ import os
2
2
  from pathlib import Path
3
3
  import subprocess
4
4
  import time
5
+ import sys
5
6
 
6
7
  from ..Butils import B_Color
7
8
 
@@ -70,6 +71,7 @@ def b_run_python(
70
71
  for string in str_lst:
71
72
  try:
72
73
  command_lst = string.split(' ')
74
+ command_lst[0] = sys.executable # 将'python'替换为当前环境下的python
73
75
  run_log("正在执行: " + string)
74
76
  start = time.time()
75
77
  result = subprocess.run(command_lst, timeout=limit_time)
@@ -0,0 +1,17 @@
1
+ import argparse
2
+
3
+ def b_zip():
4
+ parser = argparse.ArgumentParser()
5
+ parser.add_argument("dir_path")
6
+ args = parser.parse_args()
7
+
8
+ from .Barchive import b_archive_zip
9
+ b_archive_zip(args.dir_path)
10
+
11
+ def b_dirtree():
12
+ parser = argparse.ArgumentParser()
13
+ parser.add_argument("dir_path")
14
+ args = parser.parse_args()
15
+
16
+ from . import B_os
17
+ B_os.dir_tree(args.dir_path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: byzh-core
3
- Version: 0.0.9.9
3
+ Version: 0.0.9.11
4
4
  Summary: byzh-core是byzh系列的核心库,包含了一些常用的工具函数和类。
5
5
  Author: byzh_rc
6
6
  License: MIT
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
+ b_dirtree = byzh.core.__main__:b_dirtree
2
3
  b_zip = byzh.core.__main__:b_zip
@@ -14,7 +14,8 @@ setup(
14
14
  ],
15
15
  entry_points={
16
16
  "console_scripts": [
17
- "b_zip=byzh.core.__main__:b_zip" # b_zip 路径
17
+ "b_zip=byzh.core.__main__:b_zip", # b_zip 路径
18
+ "b_dirtree=byzh.core.__main__:b_dirtree", # b_dirtree 路径
18
19
  ]
19
20
  },
20
21
  )
@@ -1,9 +0,0 @@
1
- import argparse
2
-
3
- def b_zip():
4
- parser = argparse.ArgumentParser()
5
- parser.add_argument("dir_path")
6
- args = parser.parse_args()
7
-
8
- from .Barchive import b_archive_zip
9
- b_archive_zip(args.dir_path)
File without changes
File without changes
File without changes