diff --git a/build/build-macos.sh b/build/build-macos.sh index 6efb5dd..5421ca7 100755 --- a/build/build-macos.sh +++ b/build/build-macos.sh @@ -29,5 +29,6 @@ cd build brew install platypus platypus --load-profile ./BAPSicle.platypus --overwrite ./output/BAPSicle.app +chmod +x output/BAPSicle.app/Contents/Resources/BAPSicle rm ../build.py diff --git a/launch.py b/launch.py index b53a590..859b7c7 100755 --- a/launch.py +++ b/launch.py @@ -70,7 +70,7 @@ if __name__ == "__main__": if sys.argv[1] == "Presenter": webbrowser.open("http://localhost:13500/presenter/") except Exception as e: - print("ALERT:BAPSicle failed with exception of type {}:\n{}".format(type(e).__name__, str(e))) + print("ALERT:BAPSicle failed with exception of type {}:{}".format(type(e).__name__, e)) sys.exit(1) sys.exit(0) diff --git a/web_server.py b/web_server.py index e8f6c79..7972170 100644 --- a/web_server.py +++ b/web_server.py @@ -26,7 +26,10 @@ from helpers.myradio_api import MyRadioAPI env = Environment(loader=FileSystemLoader('%s/ui-templates/' % os.path.dirname(__file__)), autoescape=select_autoescape()) +LOG_FILEPATH = resolve_external_file_path("logs") +LOG_FILENAME = LOG_FILEPATH + "/WebServer.log" # From Sanic's default, but set to log to file. +os.makedirs(LOG_FILEPATH, exist_ok=True) LOGGING_CONFIG = dict( version=1, disable_existing_loggers=False, @@ -49,17 +52,17 @@ LOGGING_CONFIG = dict( "file": { "class": "logging.FileHandler", "formatter": "generic", - "filename": "logs/WebServer.log" + "filename": LOG_FILENAME }, "error_file": { "class": "logging.FileHandler", "formatter": "generic", - "filename": "logs/WebServer.log" + "filename": LOG_FILENAME }, "access_file": { "class": "logging.FileHandler", "formatter": "access", - "filename": "logs/WebServer.log" + "filename": LOG_FILENAME }, }, formatters={