From 22102e99256aaffa78c085f683fe87ef4ab7963c Mon Sep 17 00:00:00 2001 From: Yong Liaw - 1683019 Date: Wed, 3 Dec 2025 13:45:18 +1000 Subject: [PATCH 1/3] Fix get_base_path to return the path to PyFluxPro folder. --- scripts/pfp_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/pfp_utils.py b/scripts/pfp_utils.py index 18a6095..6f51170 100644 --- a/scripts/pfp_utils.py +++ b/scripts/pfp_utils.py @@ -2051,8 +2051,9 @@ def get_base_path(): base_path = sys._MEIPASS else: # running as a script - base_path = os.path.abspath(".") - return base_path + #base_path = os.path.abspath(".") + base_path = os.path.basename(os.path.dirname(os.path.abspath(__file__))) + return base_path def get_cfsection(cf, label, mode='quiet'): ''' From f3f3cc4026f85e47f1f6c01ab63c1229128b5432 Mon Sep 17 00:00:00 2001 From: Yong Liaw - 1683019 Date: Wed, 3 Dec 2025 13:46:46 +1000 Subject: [PATCH 2/3] Fix logfiles path to be created on directory it is started. --- PyFluxPro.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PyFluxPro.py b/PyFluxPro.py index 8e56d42..e67f860 100644 --- a/PyFluxPro.py +++ b/PyFluxPro.py @@ -34,9 +34,10 @@ # now check the logfiles and plots directories are present base_path = pfp_utils.get_base_path() -logfiles_path = os.path.join(base_path, "logfiles", "") -plots_path = os.path.join(base_path, "plots", "") -dir_list = [logfiles_path, plots_path] +# Create logfiles folder on current directory, so that this can be outside +# the PyFluxPro folder. +logfiles_path = os.path.join(os.path.abspath("."), "logfiles") +dir_list = [logfiles_path] for item in dir_list: if not os.path.exists(item): os.makedirs(item) From 436f3b56a85613dc7fe75c0b50187f99f0a383f9 Mon Sep 17 00:00:00 2001 From: Yong Liaw - 1683019 Date: Wed, 3 Dec 2025 16:03:36 +1000 Subject: [PATCH 3/3] Fix bug --- scripts/pfp_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pfp_utils.py b/scripts/pfp_utils.py index 6f51170..c9bb321 100644 --- a/scripts/pfp_utils.py +++ b/scripts/pfp_utils.py @@ -2052,7 +2052,7 @@ def get_base_path(): else: # running as a script #base_path = os.path.abspath(".") - base_path = os.path.basename(os.path.dirname(os.path.abspath(__file__))) + base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) return base_path def get_cfsection(cf, label, mode='quiet'):