formatize 1.0.5__tar.gz → 1.0.7__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.
- {formatize-1.0.5 → formatize-1.0.7}/PKG-INFO +1 -1
- {formatize-1.0.5 → formatize-1.0.7}/setup.cfg +1 -1
- {formatize-1.0.5 → formatize-1.0.7}/src/formatize/__init__.py +1 -1
- {formatize-1.0.5 → formatize-1.0.7}/src/formatize/form.py +30 -1
- {formatize-1.0.5 → formatize-1.0.7}/src/formatize.egg-info/PKG-INFO +1 -1
- {formatize-1.0.5 → formatize-1.0.7}/LICENSE +0 -0
- {formatize-1.0.5 → formatize-1.0.7}/README.md +0 -0
- {formatize-1.0.5 → formatize-1.0.7}/pyproject.toml +0 -0
- {formatize-1.0.5 → formatize-1.0.7}/src/formatize/const.py +0 -0
- {formatize-1.0.5 → formatize-1.0.7}/src/formatize.egg-info/SOURCES.txt +0 -0
- {formatize-1.0.5 → formatize-1.0.7}/src/formatize.egg-info/dependency_links.txt +0 -0
- {formatize-1.0.5 → formatize-1.0.7}/src/formatize.egg-info/requires.txt +0 -0
- {formatize-1.0.5 → formatize-1.0.7}/src/formatize.egg-info/top_level.txt +0 -0
|
@@ -647,7 +647,7 @@ def add_class_to_nested_module (module, class_name, cls):
|
|
|
647
647
|
setattr(module, class_name, cls)
|
|
648
648
|
|
|
649
649
|
def frender (non_f_str: str):
|
|
650
|
-
return eval(f'f"""{non_f_str}"""')
|
|
650
|
+
return eval(f'f"""{non_f_str}"""', globals())
|
|
651
651
|
|
|
652
652
|
def punctescape (text: str) -> str:
|
|
653
653
|
return re.compile(f'[{re.escape(string.punctuation)}]').sub('', text)
|
|
@@ -849,3 +849,32 @@ def window_image(filepath: str, title: str='Image Window'):
|
|
|
849
849
|
label = tk.Label(root, image=tkimg)
|
|
850
850
|
label.pack()
|
|
851
851
|
root.mainloop()
|
|
852
|
+
|
|
853
|
+
## <1.0.7>
|
|
854
|
+
|
|
855
|
+
def get_directory_tree (root_dir: str) -> list:
|
|
856
|
+
def build_tree(dir_path, prefix=''):
|
|
857
|
+
entries = []
|
|
858
|
+
items = sorted(os.listdir(dir_path))
|
|
859
|
+
for i, item in enumerate(items):
|
|
860
|
+
path = os.path.join(dir_path, item)
|
|
861
|
+
connector = '├── ' if i < len(items) - 1 else '└── '
|
|
862
|
+
entries.append(f'{prefix}{connector}{item}')
|
|
863
|
+
if os.path.isdir(path):
|
|
864
|
+
extension = '│ ' if i < len(items) - 1 else ' '
|
|
865
|
+
entries.extend(build_tree(path, prefix + extension))
|
|
866
|
+
return entries
|
|
867
|
+
tree_lines = [root_dir] + build_tree(root_dir)
|
|
868
|
+
return tree_lines
|
|
869
|
+
|
|
870
|
+
def save_directory_tree_to_md (root_dir: str, output_file: str='directory_structure.md'):
|
|
871
|
+
tree_lines = get_directory_tree(root_dir)
|
|
872
|
+
md_content = '\n'.join(tree_lines)
|
|
873
|
+
if output_file:
|
|
874
|
+
with open(output_file, 'w', encoding='utf-8') as f:
|
|
875
|
+
f.write('# Directory Structure\n\n')
|
|
876
|
+
f.write('```\n')
|
|
877
|
+
f.write(md_content)
|
|
878
|
+
f.write('\n```\n')
|
|
879
|
+
return print(f'Directory structure saved to {output_file}')
|
|
880
|
+
return md_content
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|