summarylogtreecommitdiffstats
path: root/paths-in-opt.patch
diff options
context:
space:
mode:
Diffstat (limited to 'paths-in-opt.patch')
-rw-r--r--paths-in-opt.patch60
1 files changed, 23 insertions, 37 deletions
diff --git a/paths-in-opt.patch b/paths-in-opt.patch
index d9edc30266be..72d6fe795fca 100644
--- a/paths-in-opt.patch
+++ b/paths-in-opt.patch
@@ -1,36 +1,10 @@
-diff --git a/hydrus/client/gui/ClientGUI.py b/hydrus/client/gui/ClientGUI.py
-index 2c3933e..c84a039 100644
---- a/hydrus/client/gui/ClientGUI.py
-+++ b/hydrus/client/gui/ClientGUI.py
-@@ -772,7 +772,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/client/gui/ClientGUIStyle.py b/hydrus/client/gui/ClientGUIStyle.py
-index 7de8ef2..1196c62 100644
---- a/hydrus/client/gui/ClientGUIStyle.py
-+++ b/hydrus/client/gui/ClientGUIStyle.py
-@@ -6,7 +6,7 @@ from hydrus.core import HydrusConstants as HC
- from hydrus.core import HydrusData
- from hydrus.core import HydrusExceptions
-
--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/core/HydrusConstants.py b/hydrus/core/HydrusConstants.py
-index f14ed6e..4d7a20e 100644
+index d59bf1aa..8cbf8fee 100644
--- a/hydrus/core/HydrusConstants.py
+++ b/hydrus/core/HydrusConstants.py
-@@ -5,33 +5,9 @@ import typing
- # old method of getting frozen dir, doesn't work for symlinks looks like:
- # BASE_DIR = getattr( sys, '_MEIPASS', None )
+@@ -11,34 +11,9 @@ import yaml
+ RUNNING_CLIENT = False
+ RUNNING_SERVER = False
-RUNNING_FROM_FROZEN_BUILD = getattr( sys, 'frozen', False )
-
@@ -59,15 +33,16 @@ index f14ed6e..4d7a20e 100644
-
- BASE_DIR = os.getcwd()
-
+-
+RUNNING_FROM_FROZEN_BUILD = False
+HYDRUS_MODULE_DIR = '/opt/hydrus/hydrus'
+BASE_DIR = os.path.expanduser("~/.local/share/hydrus")
- PLATFORM_WINDOWS = False
- PLATFORM_MACOS = False
-@@ -44,23 +20,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' ) )
+ muh_platform = sys.platform.lower()
+
+@@ -69,34 +44,18 @@ elif RUNNING_FROM_FROZEN_BUILD:
+ elif RUNNING_FROM_MACOS_APP:
+ NICE_RUNNING_AS_STRING = 'from App'
-BIN_DIR = os.path.join( BASE_DIR, 'bin' )
-HELP_DIR = os.path.join( BASE_DIR, 'help' )
@@ -82,14 +57,25 @@ index f14ed6e..4d7a20e 100644
-if PLATFORM_MACOS:
-
-- USERPATH_DB_DIR = os.path.join( os.path.expanduser( '~' ), 'Library', 'Hydrus' )
+- desired_userpath_db_dir = os.path.join( '~', 'Library', 'Hydrus' )
-
-else:
-
-- USERPATH_DB_DIR = os.path.join( os.path.expanduser( '~' ), 'Hydrus' )
+- desired_userpath_db_dir = os.path.join( '~', 'Hydrus' )
+-
+-
+-USERPATH_DB_DIR = os.path.expanduser( desired_userpath_db_dir )
+-
+-if USERPATH_DB_DIR == desired_userpath_db_dir:
+-
+- # could not figure it out, probably a crazy user situation atm
+-
+- USERPATH_DB_DIR = None
-
+USERPATH_DB_DIR = DEFAULT_DB_DIR
+ WE_SWITCHED_TO_USERPATH = False
+
-LICENSE_PATH = os.path.join( BASE_DIR, 'license.txt' )
+LICENSE_PATH = "/usr/share/licenses/hydrus/license.txt"