fix picons downloading from bundle

This commit is contained in:
DYefremov
2020-01-23 19:17:54 +03:00
parent af46c2fb1d
commit 3cb4f1095d
2 changed files with 8 additions and 7 deletions

View File

@@ -13,7 +13,7 @@ from app.tools.picons import PiconsParser, parse_providers, Provider, convert_to
from app.tools.satellites import SatellitesParser, SatelliteSource
from .dialogs import show_dialog, DialogType, get_message
from .main_helper import update_entry_data, append_text_to_tview, scroll_to, on_popup_menu
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, TEXT_DOMAIN, TV_ICON
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, TEXT_DOMAIN, TV_ICON, GTK_PATH
class PiconsDialog:
@@ -144,7 +144,8 @@ class PiconsDialog:
url = self._url_entry.get_text()
try:
self._current_process = subprocess.Popen(["wget", "-pkP", self._TMP_DIR, url],
exe = "{}wget".format("./" if GTK_PATH else "")
self._current_process = subprocess.Popen([exe, "-pkP", self._TMP_DIR, url],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True)
@@ -240,8 +241,9 @@ class PiconsDialog:
def resize(self, path):
self.show_info_message(get_message("Resizing..."), Gtk.MessageType.INFO)
command = "mogrify -resize {}! *.png".format(
"320x240" if self._resize_220_132_radio_button.get_active() else "100x60").split()
exe = "{}mogrify".format("./" if GTK_PATH else "")
is_220_132 = self._resize_220_132_radio_button.get_active()
command = "{} -resize {}! *.png".format(exe, "220x132" if is_220_132 else "100x60").split()
try:
self._current_process = subprocess.Popen(command, universal_newlines=True, cwd=path)
self._current_process.wait()

View File

@@ -10,6 +10,8 @@ from gi.repository import Gtk, Gdk
# path to *.glade files
UI_RESOURCES_PATH = "app/ui/" if os.path.exists("app/ui/") else "ui/"
LANG_PATH = UI_RESOURCES_PATH + "lang"
GTK_PATH = os.environ.get("GTK_PATH", None)
IS_GNOME_SESSION = int(bool(os.environ.get("GNOME_DESKTOP_SESSION_ID")))
# translation
@@ -21,12 +23,9 @@ except SettingsException:
else:
os.environ["LANGUAGE"] = settings.language
LANG_PATH = UI_RESOURCES_PATH + "lang"
if sys.platform == "darwin":
import gettext
GTK_PATH = os.environ.get("GTK_PATH", None)
if GTK_PATH:
LANG_PATH = GTK_PATH + "/share/locale"
gettext.bindtextdomain(TEXT_DOMAIN, LANG_PATH)