From 981ad3a775048af8943269a69f6baf1d740b7cdf Mon Sep 17 00:00:00 2001 From: Captain FLAM <2856272+Captain-FLAM@users.noreply.github.com> Date: Tue, 7 Nov 2023 09:56:46 +0100 Subject: [PATCH] 5.1 --- .github/FUNDING.yml | 4 ++-- KaraFan.py | 25 +++++++++---------------- KaraFan.pyw | 26 ++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 KaraFan.pyw diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 2512d83..8db8922 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,8 +1,8 @@ # These are supported funding model platforms -# github: Captain-FLAM +github: Captain-FLAM ko_fi: captain_flam -patreon: Captain_FLAM +# patreon: Captain_FLAM # open_collective: # Replace with a single Open Collective username # tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel # community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry diff --git a/KaraFan.py b/KaraFan.py index 1e77336..3f1b0e3 100644 --- a/KaraFan.py +++ b/KaraFan.py @@ -9,25 +9,18 @@ import os, sys -Project = os.getcwd() # Get the current path - -# Are we in the Parent directory ? -if os.path.basename(Project) != "KaraFan": - Project = os.path.join(Project, "KaraFan") - - if not os.path.exists(Project): - print('ERROR : "KaraFan" folder not found !') - os._exit(0) - - # os.chdir(Project) +Gdrive = os.getcwd() +Project = os.path.join(Gdrive, "KaraFan") + +# Are we in the Project directory ? +if not os.path.exists(Project): + Gdrive = os.path.dirname(Gdrive) # Go to Parent directory + Project = os.path.join(Gdrive, "KaraFan") + os.chdir(Gdrive) # Mandatory to import App modules sys.path.insert(0, Project) import App.main -Gdrive = os.path.dirname(Project) # Get Parent directory - -params = {'Gdrive': Gdrive, 'Project': Project, 'isColab': False} - -App.main.Start(params, GUI = "wxpython") +App.main.Start({'Gdrive': Gdrive, 'Project': Project, 'isColab': False}, GUI = "wxpython") diff --git a/KaraFan.pyw b/KaraFan.pyw new file mode 100644 index 0000000..3f1b0e3 --- /dev/null +++ b/KaraFan.pyw @@ -0,0 +1,26 @@ +#! python3.11 + +# MIT License - Copyright (c) 2023 - Captain FLAM +# +# https://github.com/Captain-FLAM/KaraFan + + +# KaraFan works on your PC !! + +import os, sys + +Gdrive = os.getcwd() +Project = os.path.join(Gdrive, "KaraFan") + +# Are we in the Project directory ? +if not os.path.exists(Project): + Gdrive = os.path.dirname(Gdrive) # Go to Parent directory + Project = os.path.join(Gdrive, "KaraFan") + os.chdir(Gdrive) + +# Mandatory to import App modules +sys.path.insert(0, Project) + +import App.main + +App.main.Start({'Gdrive': Gdrive, 'Project': Project, 'isColab': False}, GUI = "wxpython")