summarylogtreecommitdiffstats
path: root/paths-in-opt.patch
blob: 31aa58ca949b9aae4d7daa13e16aecfcd5f4d5fb (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
diff --git a/include/ClientGUI.py b/include/ClientGUI.py
index df287e2..af0afba 100755
--- a/include/ClientGUI.py
+++ b/include/ClientGUI.py
@@ -136,7 +136,7 @@ class FrameGUI( ClientGUICommon.FrameThatResizes ):
         aboutinfo.SetVersion( HydrusData.ToString( HC.SOFTWARE_VERSION ) + ', using network version ' + HydrusData.ToString( HC.NETWORK_VERSION ) )
         aboutinfo.SetDescription( CC.CLIENT_DESCRIPTION )
         
-        with open( HC.BASE_DIR + os.path.sep + 'license.txt', 'rb' ) as f: license = f.read()
+        with open( '/usr/share/licenses/hydrus/license.txt', 'rb' ) as f: license = f.read()
         
         aboutinfo.SetLicense( license )
         
@@ -1987,7 +1987,7 @@ The password is cleartext here but obscured in the entry dialog. Enter a blank p
                 
             elif command == '8chan_board': webbrowser.open( 'http://8ch.net/hydrus/index.html' )
             elif command == 'file_integrity': self._CheckFileIntegrity()
-            elif command == 'help': webbrowser.open( 'file://' + HC.BASE_DIR + '/help/index.html' )
+            elif command == 'help': webbrowser.open( 'file:///opt/hydrus/help/index.html' )
             elif command == 'help_about': self._AboutWindow()
             elif command == 'help_shortcuts': wx.MessageBox( CC.SHORTCUT_HELP )
             elif command == 'import_files': self._ImportFiles()
diff --git a/include/ClientGUIDialogs.py b/include/ClientGUIDialogs.py
index 57eb0a1..e178693 100755
--- a/include/ClientGUIDialogs.py
+++ b/include/ClientGUIDialogs.py
@@ -628,7 +628,7 @@ class DialogFirstStart( Dialog ):
         self._ok.SetForegroundColour( ( 0, 128, 0 ) )
         
         message1 = 'Hi, this looks like the first time you have started the hydrus client. Don\'t forget to check out the'
-        link = wx.HyperlinkCtrl( self, id = -1, label = 'help', url = 'file://' + HC.BASE_DIR + '/help/index.html' )
+        link = wx.HyperlinkCtrl( self, id = -1, label = 'help', url = 'file:///opt/hydrus/help/index.html' )
         message2 = 'if you haven\'t already.'
         message3 = 'When you close this dialog, the client will start its local http server. You will probably get a firewall warning.'
         message4 = 'You can block it if you like, or you can allow it. It doesn\'t phone home, or expose your files to your network; it just provides another way to locally export your files.'
diff --git a/include/ClientLocalServerResources.py b/include/ClientLocalServerResources.py
index 4d8c363..b5119b6 100644
--- a/include/ClientLocalServerResources.py
+++ b/include/ClientLocalServerResources.py
@@ -242,11 +242,11 @@ class HydrusResourceCommandBooruThumbnail( HydrusResourceCommandBooru ):
         mime = media_result.GetMime()
         
         if mime in HC.MIMES_WITH_THUMBNAILS: path = ClientFiles.GetThumbnailPath( hash, full_size = False )
-        elif mime in HC.AUDIO: path = HC.STATIC_DIR + os.path.sep + 'audio_resized.png'
-        elif mime in HC.VIDEO: path = HC.STATIC_DIR + os.path.sep + 'video_resized.png'
-        elif mime == HC.APPLICATION_FLASH: path = HC.STATIC_DIR + os.path.sep + 'flash_resized.png'
-        elif mime == HC.APPLICATION_PDF: path = HC.STATIC_DIR + os.path.sep + 'pdf_resized.png'
-        else: path = HC.STATIC_DIR + os.path.sep + 'hydrus_resized.png'
+        elif mime in HC.AUDIO: path = HC.TEMP_DIR + os.path.sep + 'audio_resized.png'
+        elif mime in HC.VIDEO: path = HC.TEMP_DIR + os.path.sep + 'video_resized.png'
+        elif mime == HC.APPLICATION_FLASH: path = HC.TEMP_DIR + os.path.sep + 'flash_resized.png'
+        elif mime == HC.APPLICATION_PDF: path = HC.TEMP_DIR + os.path.sep + 'pdf_resized.png'
+        else: path = HC.TEMP_DIR + os.path.sep + 'hydrus_resized.png'
         
         response_context = HydrusServerResources.ResponseContext( 200, path = path )
         
@@ -278,4 +278,4 @@ class HydrusResourceCommandLocalThumbnail( HydrusServerResources.HydrusResourceC
         
         return response_context
         
-    
\ No newline at end of file
+    
diff --git a/include/HydrusConstants.py b/include/HydrusConstants.py
index e3fea73..5c87f83 100755
--- a/include/HydrusConstants.py
+++ b/include/HydrusConstants.py
@@ -3,9 +3,9 @@ import sys
 
 # dirs
 
-BASE_DIR = sys.path[0]
+BASE_DIR = os.path.expanduser("~/.local/share/hydrus")
 
-BIN_DIR = BASE_DIR + os.path.sep + 'bin'
+BIN_DIR = "/opt/hydrus/bin"
 DB_DIR = BASE_DIR + os.path.sep + 'db'
 CLIENT_ARCHIVES_DIR = DB_DIR + os.path.sep + 'client_archives'
 CLIENT_FILES_DIR = DB_DIR + os.path.sep + 'client_files'
@@ -16,8 +16,14 @@ SERVER_MESSAGES_DIR = DB_DIR + os.path.sep + 'server_messages'
 CLIENT_UPDATES_DIR = DB_DIR + os.path.sep + 'client_updates'
 SERVER_UPDATES_DIR = DB_DIR + os.path.sep + 'server_updates'
 LOGS_DIR = BASE_DIR + os.path.sep + 'logs'
-STATIC_DIR = BASE_DIR + os.path.sep + 'static'
-
+STATIC_DIR = '/opt/hydrus/static'
+TEMP_DIR = BASE_DIR + os.path.sep + 'temp'
+
+for dirs in [LOGS_DIR, TEMP_DIR, DB_DIR]:
+    try:
+        os.makedirs(dirs)
+    except os.error:
+        pass
 #
 
 PLATFORM_WINDOWS = False