mirror of
https://github.com/csd4ni3l/game-of-life.git
synced 2025-11-05 05:58:06 +01:00
Resolving filepaths in both onefile and standalone modes for Nuitka
This commit is contained in:
9
run.py
9
run.py
@@ -4,6 +4,12 @@ pyglet.options.debug_gl = False
|
||||
|
||||
import logging, datetime, os, json, sys, arcade
|
||||
|
||||
# Set up paths BEFORE importing modules that load assets
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
pyglet.resource.path.append(script_dir)
|
||||
pyglet.font.add_directory(os.path.join(script_dir, 'assets', 'fonts'))
|
||||
|
||||
|
||||
from utils.utils import get_closest_resolution, print_debug_info, on_exception
|
||||
from utils.constants import log_dir, menu_background_color
|
||||
from menus.main import Main
|
||||
@@ -12,9 +18,6 @@ from arcade.experimental.controller_window import ControllerWindow
|
||||
|
||||
sys.excepthook = on_exception
|
||||
|
||||
pyglet.resource.path.append(os.getcwd())
|
||||
pyglet.font.add_directory('./assets/fonts')
|
||||
|
||||
__builtins__.print = lambda *args, **kwargs: logging.debug(" ".join(map(str, args)))
|
||||
|
||||
if not log_dir in os.listdir():
|
||||
|
||||
Reference in New Issue
Block a user