summarylogtreecommitdiffstats
path: root/paths-in-opt.patch
blob: c2f6565931d33efbe43ea897482d37c2d0634c47 (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
diff --git a/include/ClientGUI.py b/include/ClientGUI.py
index 38e41ce..1e7fa76 100755
--- a/include/ClientGUI.py
+++ b/include/ClientGUI.py
@@ -139,7 +139,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 )
         
@@ -2067,7 +2067,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 f765182..66b7347 100755
--- a/include/ClientGUIDialogs.py
+++ b/include/ClientGUIDialogs.py
@@ -630,7 +630,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 c7cc159..dfb34aa 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 )
         
diff --git a/include/HydrusConstants.py b/include/HydrusConstants.py
index b719882..be7cf52 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