summarylogtreecommitdiffstats
path: root/paths-in-opt.patch
blob: 2e61830089134bafc555e539e4afe3ff80f66e90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
diff --git a/include/ClientGUI.py b/include/ClientGUI.py
index 479efc1..86cbd71 100755
--- a/include/ClientGUI.py
+++ b/include/ClientGUI.py
@@ -598,7 +598,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/include/HydrusConstants.py b/include/HydrusConstants.py
index 9ec3402..0ea9266 100755
--- a/include/HydrusConstants.py
+++ b/include/HydrusConstants.py
@@ -2,30 +2,9 @@ import os
 import sys
 
 # dirs
+RUNNING_FROM_FROZEN_BUILD = False
 
-if getattr( sys, 'frozen', False ):
-    
-    RUNNING_FROM_FROZEN_BUILD = True
-    
-    # we are in a pyinstaller frozen app
-    
-    BASE_DIR = getattr( sys, '_MEIPASS', None )
-    
-    if BASE_DIR is None:
-        
-        raise Exception( 'It seems this hydrus is running from a frozen bundle, but there was no _MEIPASS variable under sys to define the bundle directory.' )
-        
-    
-else:
-    
-    RUNNING_FROM_FROZEN_BUILD = False
-    
-    BASE_DIR = sys.path[0]
-    
-    if BASE_DIR == '':
-        
-        BASE_DIR = os.getcwd()
-        
+BASE_DIR = os.path.expanduser("~/.local/share/hydrus")
 
 PLATFORM_WINDOWS = False
 PLATFORM_MACOS  = False
@@ -38,23 +17,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"
 
 #