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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: formatize
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: Literp Formatting Lib
5
5
  Home-page: https://github.com/asinerum/formatize
6
6
  Author: Asinerum Conlang Project
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = formatize
3
- version = 1.0.6
3
+ version = 1.0.8
4
4
  author = Asinerum Conlang Project
5
5
  author_email = asinerum.com@gmail.com
6
6
  description = Literp Formatting Lib
@@ -1,4 +1,4 @@
1
1
  from .form import *
2
2
  from .const import *
3
3
 
4
- __version__ = "1.0.6"
4
+ __version__ = "1.0.8"
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: formatize
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: Literp Formatting Lib
5
5
  Home-page: https://github.com/asinerum/formatize
6
6
  Author: Asinerum Conlang Project
File without changes
File without changes
File without changes