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.
- {byzh_core-0.0.9.9/byzh_core.egg-info → byzh_core-0.0.9.11}/PKG-INFO +1 -1
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/B_os.py +33 -1
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bterminal/cmd.py +2 -0
- byzh_core-0.0.9.11/byzh/core/__main__.py +17 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11/byzh_core.egg-info}/PKG-INFO +1 -1
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/entry_points.txt +1 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/setup.py +2 -1
- byzh_core-0.0.9.9/byzh/core/__main__.py +0 -9
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/LICENSE +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/README.md +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Barchive/__init__.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Barchive/archive.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Brecorder/__init__.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Brecorder/record1d.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Brecorder/record2d.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Btable/__init__.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Btable/auto_table.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bterminal/__init__.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bterminal/run_func.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Btqdm/__init__.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Btqdm/my_tqdm.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Butils/__init__.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Butils/decorator.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Butils/text_style.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Butils/timer.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bwriter/__init__.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/Bwriter/writer.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh/core/__init__.py +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/SOURCES.txt +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/dependency_links.txt +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/requires.txt +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/byzh_core.egg-info/top_level.txt +0 -0
- {byzh_core-0.0.9.9 → byzh_core-0.0.9.11}/setup.cfg +0 -0
@@ -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)
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|