From 889c73c9b1ed39852341da7059efd65c904ad8a9 Mon Sep 17 00:00:00 2001 From: Emanuele Date: Tue, 27 Oct 2020 12:38:03 +0100 Subject: [PATCH] build 1.42 per mac, crea correttamente file .app --- .DS_Store | Bin 6148 -> 6148 bytes SPEx/scripts/create_SPEX.zsh | 8 ++++---- SPEx/spex/guimain.py | 10 +++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.DS_Store b/.DS_Store index c7d3b03ccd63ff0b621ded3a69de75cd404a8126..c30e46c7e14c8290ae73ac8c34a888f22916f4a3 100644 GIT binary patch delta 66 zcmZoMXfc@J&&aVcU^g=($7CKB)5*Q8S(9h7w1}FTo9ZZ-n3>keH_Lbai>rIC(;xw*k)7gkec943|p7v<&T=cO|+FfdNGW65PaIe86BgQi4v zwYdezBvY_ShQ`J~lT1x(YdJZ@RSj)D6LKr7s%vWNW=;-cm1mr_xs26~aWgx|Uw!~Q CjWLJ- diff --git a/SPEx/scripts/create_SPEX.zsh b/SPEx/scripts/create_SPEX.zsh index a53c185..9366999 100755 --- a/SPEx/scripts/create_SPEX.zsh +++ b/SPEx/scripts/create_SPEX.zsh @@ -7,13 +7,13 @@ pyinstaller --add-data="../.venv/lib/python3.7/site-packages/text_unidecode/data --noconfirm \ --paths ./libbananasplit --paths ./UserInterface/compiledUI \ --name=SPEx \ - --onefile \ --windowed \ + --strip \ --osx-bundle-identifier="12parsec.software.SPEx" \ ../spex/guimain.py echo "Copio configurazione" -cp -r ../conf ./dist/SPEx.app/Contents/MacOS/conf/ +cp -r ../conf ./dist/SPEx.app/Contents/Resources/ cp -r ../conf ./dist/ echo "Copio file binari" mv ./dist/ ../bin/ @@ -21,5 +21,5 @@ echo "Rinuovo cartella build" rm -rf ./build echo "Firmo il codice" cd ../bin/dist -#codesign --deep -s "12Parsec" SPEx.app -#codesign --deep -s "12Parsec" SPEx \ No newline at end of file +codesign --deep -s "12Parsec" SPEx.app +codesign --deep -s "12Parsec" SPEx \ No newline at end of file diff --git a/SPEx/spex/guimain.py b/SPEx/spex/guimain.py index eb77933..a74b595 100644 --- a/SPEx/spex/guimain.py +++ b/SPEx/spex/guimain.py @@ -10,6 +10,7 @@ import sys import copy import json import os +import platform from mainwindow import Ui_mainwin from selezout import Ui_selezout @@ -624,9 +625,12 @@ if __name__ == '__main__': try: #print(f"Running directory {os.environ['WORKSPACELOC']}") #print(f"Pythonpath: {os.environ['PYTHONPATH']}") - print("LAUNCHDIR:", os.getcwd()) - LOGGER = fancyLogger(filepath=r"./conf/loggerconf.json", fileLog=False) - conf = bananaCONF(workdir=r"./conf", logger=LOGGER) + if platform.system() == 'Darwin': + basePath = '/'+'/'.join(sys.executable.split('/')[1:-2])+'/Resources' + else: + basePath = './' + LOGGER = fancyLogger(filepath=f"{basePath}/conf/loggerconf.json", fileLog=False) + conf = bananaCONF(workdir=f"{basePath}/conf", logger=LOGGER) conf.open() conf.use("defaults.json") conf.use(conf.getParam('paths', 'lastUsed'))