Simplify path vars

merge-requests/64/head
Hugo Posnic 2017-05-07 18:33:51 +02:00
parent f04da08e60
commit 91ef4b2e3f
1 changed files with 17 additions and 17 deletions

View File

@ -19,31 +19,31 @@ class ManjaroHello():
# App vars # App vars
self.app = "manjaro-hello" self.app = "manjaro-hello"
# Path vars # Paths
self.home_path = os.path.expanduser("~") self.home_path = os.path.expanduser("~")
self.logo_path = "/usr/share/icons/hicolor/64x64/apps/manjaro.png" self.config_path = self.home_path + "/.config/"
if os.path.basename(sys.argv[0]) == self.app: share_path = "/usr/share/"
self.data_path = "/usr/share/" + self.app + "/data/"
self.locale_path = "/usr/share/locale/"
self.ui_path = "/usr/share/" + self.app + "/ui/"
self.desktop_path = "/usr/share/applications/" + self.app + ".desktop"
else:
self.data_path = "data/" self.data_path = "data/"
self.locale_path = "locale/" self.locale_path = "locale/"
self.ui_path = "ui/" self.ui_path = "ui/"
self.desktop_path = os.getcwd() + "/" + self.app + ".desktop" self.desktop_path = self.app + ".desktop"
self.config_path = self.home_path + "/.config/"
if os.path.basename(sys.argv[0]) == self.app:
self.data_path = share_path + self.app + self.data_path
self.locale_path = share_path + self.locale_path
self.ui_path = share_path + self.app + "/" + self.ui_path
self.desktop_path = share_path + "applications/" + self.desktop_path
else:
self.desktop_path = os.getcwd() + "/" + self.desktop_path
self.logo_path = share_path + "icons/hicolor/64x64/apps/manjaro.png"
self.preferences_path = self.config_path + self.app + ".json" self.preferences_path = self.config_path + self.app + ".json"
self.urls_path = self.data_path + "urls.json" self.urls_path = self.data_path + "urls.json"
self.autostart_path = self.config_path + "autostart/" + self.app + ".desktop" self.autostart_path = self.config_path + "autostart/" + self.app + ".desktop"
# Load preferences # Load important vars
self.preferences = self.get_preferences() self.preferences = self.get_preferences()
# Load system infos
self.infos = get_infos() self.infos = get_infos()
# Load data files
self.urls = read_json(self.urls_path) self.urls = read_json(self.urls_path)
# Init window # Init window