From dfd05e1732cc41ba46eb36c0f86b4accd3875b9b Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Fri, 10 Jan 2025 18:55:07 +0100 Subject: [PATCH] Added utils.py and improved the example of the tree view. --- wobbl_tools/text/tree_view.py | 5 +++-- wobbl_tools/utils.py | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 wobbl_tools/utils.py diff --git a/wobbl_tools/text/tree_view.py b/wobbl_tools/text/tree_view.py index defdca4..7b5fdcd 100644 --- a/wobbl_tools/text/tree_view.py +++ b/wobbl_tools/text/tree_view.py @@ -1,6 +1,7 @@ #!/usr/bin/python3 import os -from wobbl_tools.text.format import format_string +from ..utils import module_path +from .format import format_string def tree_view( @@ -64,4 +65,4 @@ def tree_view( if __name__ == "__main__": - print(tree_view("/home/emil/Dokumente/python/wobbl_tools/wobbl_tools/", exclude_names=["__pycache__"])) + print(tree_view(module_path, exclude_names=["__pycache__"])) diff --git a/wobbl_tools/utils.py b/wobbl_tools/utils.py new file mode 100644 index 0000000..58d686c --- /dev/null +++ b/wobbl_tools/utils.py @@ -0,0 +1,5 @@ +#!/usr/bin/python3 + +import os + +module_path = os.path.dirname(os.path.abspath(__file__))