diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index a6be99f..fe357fd 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -32,12 +32,12 @@ from common import Manager, Provider, Channel, MOVIES_GROUP, PROVIDERS_PATH, SERIES_GROUP, TV_GROUP,\ async_function, idle_function - +base = os.environ.get('HYPNOTIX_BASE', '') setproctitle.setproctitle("hypnotix") # i18n APP = "hypnotix" -LOCALE_DIR = "/usr/share/locale" +LOCALE_DIR = base + "/usr/share/locale" locale.bindtextdomain(APP, LOCALE_DIR) gettext.bindtextdomain(APP, LOCALE_DIR) gettext.textdomain(APP) @@ -71,7 +71,7 @@ } COUNTRY_CODES = {} -with open("/usr/share/hypnotix/countries.list") as f: +with open(base + "/usr/share/hypnotix/countries.list") as f: for line in f: line = line.strip() code, name = line.split(":") @@ -148,7 +148,7 @@ def __init__(self, application): # Used for redownloading timer self.reload_timeout_sec = 60 * 5 self._timerid = -1 - gladefile = "/usr/share/hypnotix/hypnotix.ui" + gladefile = base + "/usr/share/hypnotix/hypnotix.ui" self.builder = Gtk.Builder() self.builder.set_translation_domain(APP) self.builder.add_from_file(gladefile) @@ -160,7 +160,7 @@ def __init__(self, application): self.info_window = self.builder.get_object("stream_info_window") provider = Gtk.CssProvider() - provider.load_from_path("/usr/share/hypnotix/hypnotix.css") + provider.load_from_path(base + "/usr/share/hypnotix/hypnotix.css") screen = Gdk.Display.get_default_screen(Gdk.Display.get_default()) # I was unable to found instrospected version of this Gtk.StyleContext.add_provider_for_screen( @@ -392,9 +392,9 @@ def __init__(self, application): self.provider_type_combo.set_active(0) # Select 1st type self.provider_type_combo.connect("changed", self.on_provider_type_combo_changed) - self.tv_logo.set_from_surface(self.get_surface_for_file("/usr/share/hypnotix/pictures/tv.svg", 258, 258)) - self.movies_logo.set_from_surface(self.get_surface_for_file("/usr/share/hypnotix/pictures/movies.svg", 258, 258)) - self.series_logo.set_from_surface(self.get_surface_for_file("/usr/share/hypnotix/pictures/series.svg", 258, 258)) + self.tv_logo.set_from_surface(self.get_surface_for_file(base + "/usr/share/hypnotix/pictures/tv.svg", 258, 258)) + self.movies_logo.set_from_surface(self.get_surface_for_file(base + "/usr/share/hypnotix/pictures/movies.svg", 258, 258)) + self.series_logo.set_from_surface(self.get_surface_for_file(base + "/usr/share/hypnotix/pictures/series.svg", 258, 258)) self.reload(page="landing_page") @@ -689,7 +689,7 @@ def get_channel_surface(self, path): else: surface = self.get_surface_for_file(path, 200, 200) except Exception: - surface = self.get_surface_for_file("/usr/share/hypnotix/generic_tv_logo.png", 22, 22) + surface = self.get_surface_for_file(base + "/usr/share/hypnotix/generic_tv_logo.png", 22, 22) return surface def on_go_back_button(self, widget=None): @@ -836,7 +836,7 @@ def navigate_to(self, page, name="", favorites=False): self.headerbar.set_subtitle(_("Reset providers")) def open_keyboard_shortcuts(self, widget): - gladefile = "/usr/share/hypnotix/shortcuts.ui" + gladefile = base + "/usr/share/hypnotix/shortcuts.ui" builder = Gtk.Builder() builder.set_translation_domain(APP) builder.add_from_file(gladefile)