diff --git a/include/ClientGUI.py b/include/ClientGUI.py index 1ca58f2..3394ced 100755 --- a/include/ClientGUI.py +++ b/include/ClientGUI.py @@ -156,7 +156,7 @@ class FrameGUI( ClientGUICommon.FrameThatResizes ): aboutinfo.SetVersion( str( HC.SOFTWARE_VERSION ) + ', using network version ' + str( HC.NETWORK_VERSION ) ) aboutinfo.SetDescription( CC.CLIENT_DESCRIPTION ) - with open( os.path.join( HC.BASE_DIR, '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 ) @@ -312,7 +312,7 @@ class FrameGUI( ClientGUICommon.FrameThatResizes ): server_executable = server_executable.replace( 'pythonw', 'python' ) - subprocess.Popen( [ server_executable, os.path.join( HC.BASE_DIR, 'server.py' ) ] ) + subprocess.Popen( [ server_executable, '/opt/hydrus/server.py' ] ) time_waited = 0 diff --git a/include/HydrusConstants.py b/include/HydrusConstants.py index 8627244..50dda3e 100755 --- a/include/HydrusConstants.py +++ b/include/HydrusConstants.py @@ -3,36 +3,25 @@ import sys # dirs -BASE_DIR = sys.path[0] - -if BASE_DIR == '': - - BASE_DIR = os.getcwdu() - -else: - - try: - - BASE_DIR = BASE_DIR.decode( 'utf-8' ) - - except: - - pass - - -BIN_DIR = os.path.join( BASE_DIR, 'bin' ) +BASE_DIR = os.path.expanduser("~/.local/share/hydrus") + +BIN_DIR = "/opt/hydrus/bin" DB_DIR = os.path.join( BASE_DIR, 'db' ) SERVER_FILES_DIR = os.path.join( DB_DIR, 'server_files' ) CLIENT_THUMBNAILS_DIR = os.path.join( DB_DIR, 'client_thumbnails' ) SERVER_THUMBNAILS_DIR = os.path.join( DB_DIR, 'server_thumbnails' ) CLIENT_UPDATES_DIR = os.path.join( DB_DIR, 'client_updates' ) SERVER_UPDATES_DIR = os.path.join( DB_DIR, 'server_updates' ) -HELP_DIR = os.path.join( BASE_DIR, 'help' ) +HELP_DIR = "/opt/hydrus/help" INCLUDE_DIR = os.path.join( BASE_DIR, 'include' ) LOGS_DIR = os.path.join( BASE_DIR, 'logs' ) -STATIC_DIR = os.path.join( BASE_DIR, 'static' ) +STATIC_DIR = "/opt/hydrus/static" -# +for dirs in [LOGS_DIR, DB_DIR]: + try: + os.makedirs(dirs) + except os.error: + pass PLATFORM_WINDOWS = False PLATFORM_OSX = False