diff --git a/hydrus/ClientGUI.py b/hydrus/ClientGUI.py index 7cec25b..b4e24e5 100644 --- a/hydrus/ClientGUI.py +++ b/hydrus/ClientGUI.py @@ -739,7 +739,7 @@ class FrameGUI( ClientGUITopLevelWindows.MainFrameThatResizes ): python_executable = python_executable.replace( 'pythonw', 'python' ) - server_script_path = os.path.join( HC.BASE_DIR, 'server.py' ) + server_script_path = '/opt/hydrus/server.py' cmd = [ python_executable, server_script_path, db_param ] diff --git a/hydrus/ClientGUIStyle.py b/hydrus/ClientGUIStyle.py index 63510b1..b5fc2f6 100644 --- a/hydrus/ClientGUIStyle.py +++ b/hydrus/ClientGUIStyle.py @@ -4,7 +4,7 @@ from . import HydrusExceptions import os from qtpy import QtWidgets as QW -STYLESHEET_DIR = os.path.join( HC.BASE_DIR, 'static', 'qss' ) +STYLESHEET_DIR = os.path.join( HC.STATIC_DIR, 'qss' ) DEFAULT_HYDRUS_STYLESHEET = '' ORIGINAL_STYLE_NAME = None diff --git a/hydrus/HydrusConstants.py b/hydrus/HydrusConstants.py index a8684e2..717b3cc 100644 --- a/hydrus/HydrusConstants.py +++ b/hydrus/HydrusConstants.py @@ -4,31 +4,8 @@ import sys # old method of getting frozen dir, doesn't work for symlinks looks like: # BASE_DIR = getattr( sys, '_MEIPASS', None ) -RUNNING_FROM_FROZEN_BUILD = getattr( sys, 'frozen', False ) - -if RUNNING_FROM_FROZEN_BUILD: - - real_exe_path = os.path.realpath( sys.executable ) - - BASE_DIR = os.path.dirname( real_exe_path ) - -else: - - try: - - hc_realpath_dir = os.path.dirname( os.path.realpath( __file__ ) ) - - BASE_DIR = os.path.split( hc_realpath_dir )[0] - - except NameError: # if __file__ is not defined due to some weird OS - - BASE_DIR = os.path.realpath( sys.path[0] ) - - - if BASE_DIR == '': - - BASE_DIR = os.getcwd() - +RUNNING_FROM_FROZEN_BUILD = False +BASE_DIR = os.path.expanduser("~/.local/share/hydrus") PLATFORM_WINDOWS = False PLATFORM_MACOS = False @@ -41,23 +18,16 @@ elif sys.platform == 'linux': PLATFORM_LINUX = True RUNNING_FROM_SOURCE = sys.argv[0].endswith( '.py' ) or sys.argv[0].endswith( '.pyw' ) RUNNING_FROM_MACOS_APP = os.path.exists( os.path.join( BASE_DIR, 'running_from_app' ) ) -BIN_DIR = os.path.join( BASE_DIR, 'bin' ) -HELP_DIR = os.path.join( BASE_DIR, 'help' ) -INCLUDE_DIR = os.path.join( BASE_DIR, 'include' ) -STATIC_DIR = os.path.join( BASE_DIR, 'static' ) +BIN_DIR = "/opt/hydrus/bin" +HELP_DIR = "/opt/hydrus/help" +INCLUDE_DIR = "/opt/hydrus/include" +STATIC_DIR = "/opt/hydrus/static" DEFAULT_DB_DIR = os.path.join( BASE_DIR, 'db' ) -if PLATFORM_MACOS: - - USERPATH_DB_DIR = os.path.join( os.path.expanduser( '~' ), 'Library', 'Hydrus' ) - -else: - - USERPATH_DB_DIR = os.path.join( os.path.expanduser( '~' ), 'Hydrus' ) - +USERPATH_DB_DIR = DEFAULT_DB_DIR -LICENSE_PATH = os.path.join( BASE_DIR, 'license.txt' ) +LICENSE_PATH = "/usr/share/licenses/hydrus/license.txt" #