From 7a70f50ab827a71fac1dab28b39dff83c21ea4d2 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Mon, 16 Aug 2021 19:50:54 +0200 Subject: [PATCH] Fixing some bugs on MacOS related to building. --- LogarithmPlotter/logarithmplotter.py | 12 +++++++++--- build-macosx.sh | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/LogarithmPlotter/logarithmplotter.py b/LogarithmPlotter/logarithmplotter.py index f1354bd..0072aec 100644 --- a/LogarithmPlotter/logarithmplotter.py +++ b/LogarithmPlotter/logarithmplotter.py @@ -37,8 +37,15 @@ from webbrowser import open as openWeb tmpfile = mkstemp(suffix='.png')[1] pwd = getcwd() -from . import config, __VERSION__ -from .update import check_for_updates +chdir(path.dirname(path.realpath(__file__))) + +from sys import path as sys_path +if path.realpath(path.join(getcwd(), "..")) not in sys_path: + sys_path.append(path.realpath(path.join(getcwd(), ".."))) + + +from LogarithmPlotter import config, __VERSION__ +from LogarithmPlotter.update import check_for_updates config.init() @@ -136,7 +143,6 @@ class Helper(QObject): openWeb(url) def run(): - chdir(path.dirname(path.realpath(__file__))) environ["QT_QUICK_CONTROLS_STYLE"] = { "linux": get_linux_theme(), diff --git a/build-macosx.sh b/build-macosx.sh index 197550c..5e17dff 100755 --- a/build-macosx.sh +++ b/build-macosx.sh @@ -17,6 +17,6 @@ pyinstaller --add-data "LogarithmPlotter/qml:qml" \ --icon=mac/logarithmplotter.icns \ --osx-bundle-identifier eu.ad5001.LogarithmPlotter \ -n LogarithmPlotter \ - LogarithmPlotter/__init__.py + LogarithmPlotter/logarithmplotter.py cp mac/Info.plist dist/LogarithmPlotter.app/Contents/Info.plist