formatize 1.0.6__tar.gz → 1.0.8__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.6 → formatize-1.0.8}/PKG-INFO +1 -1
- {formatize-1.0.6 → formatize-1.0.8}/setup.cfg +1 -1
- {formatize-1.0.6 → formatize-1.0.8}/src/formatize/__init__.py +1 -1
- {formatize-1.0.6 → formatize-1.0.8}/src/formatize/form.py +30 -0
- {formatize-1.0.6 → formatize-1.0.8}/src/formatize.egg-info/PKG-INFO +1 -1
- {formatize-1.0.6 → formatize-1.0.8}/LICENSE +0 -0
- {formatize-1.0.6 → formatize-1.0.8}/README.md +0 -0
- {formatize-1.0.6 → formatize-1.0.8}/pyproject.toml +0 -0
- {formatize-1.0.6 → formatize-1.0.8}/src/formatize/const.py +0 -0
- {formatize-1.0.6 → formatize-1.0.8}/src/formatize.egg-info/SOURCES.txt +0 -0
- {formatize-1.0.6 → formatize-1.0.8}/src/formatize.egg-info/dependency_links.txt +0 -0
- {formatize-1.0.6 → formatize-1.0.8}/src/formatize.egg-info/requires.txt +0 -0
- {formatize-1.0.6 → formatize-1.0.8}/src/formatize.egg-info/top_level.txt +0 -0
|
@@ -3,6 +3,7 @@ from typing import List, Dict, Optional
|
|
|
3
3
|
from importlib import import_module
|
|
4
4
|
from bs4 import BeautifulSoup
|
|
5
5
|
|
|
6
|
+
import os
|
|
6
7
|
import re
|
|
7
8
|
import sys
|
|
8
9
|
import types
|
|
@@ -849,3 +850,32 @@ def window_image(filepath: str, title: str='Image Window'):
|
|
|
849
850
|
label = tk.Label(root, image=tkimg)
|
|
850
851
|
label.pack()
|
|
851
852
|
root.mainloop()
|
|
853
|
+
|
|
854
|
+
## <1.0.7>
|
|
855
|
+
|
|
856
|
+
def get_directory_tree (root_dir: str) -> list:
|
|
857
|
+
def build_tree(dir_path, prefix=''):
|
|
858
|
+
entries = []
|
|
859
|
+
items = sorted(os.listdir(dir_path))
|
|
860
|
+
for i, item in enumerate(items):
|
|
861
|
+
path = os.path.join(dir_path, item)
|
|
862
|
+
connector = '├── ' if i < len(items) - 1 else '└── '
|
|
863
|
+
entries.append(f'{prefix}{connector}{item}')
|
|
864
|
+
if os.path.isdir(path):
|
|
865
|
+
extension = '│ ' if i < len(items) - 1 else ' '
|
|
866
|
+
entries.extend(build_tree(path, prefix + extension))
|
|
867
|
+
return entries
|
|
868
|
+
tree_lines = [root_dir] + build_tree(root_dir)
|
|
869
|
+
return tree_lines
|
|
870
|
+
|
|
871
|
+
def save_directory_tree_to_md (root_dir: str, output_file: str='directory_structure.md'):
|
|
872
|
+
tree_lines = get_directory_tree(root_dir)
|
|
873
|
+
md_content = '\n'.join(tree_lines)
|
|
874
|
+
if output_file:
|
|
875
|
+
with open(output_file, 'w', encoding='utf-8') as f:
|
|
876
|
+
f.write('# Directory Structure\n\n')
|
|
877
|
+
f.write('```\n')
|
|
878
|
+
f.write(md_content)
|
|
879
|
+
f.write('\n```\n')
|
|
880
|
+
return print(f'Directory structure saved to {output_file}')
|
|
881
|
+
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
|