From 5e954c7ec9bf6195be92392fd2afe77ea36656b2 Mon Sep 17 00:00:00 2001 From: Dmitriy Yefremov Date: Sat, 30 Dec 2017 22:58:47 +0300 Subject: [PATCH] paths fix --- README.md | 22 ---------------------- app/ftp.py | 1 + app/properties.py | 4 ++-- app/ui/dialogs.py | 2 +- app/ui/main_app_window.py | 12 +++++++----- app/ui/satellites_dialog.py | 2 +- 6 files changed, 12 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 01489fc1..c0175c9c 100644 --- a/README.md +++ b/README.md @@ -2,25 +2,3 @@ Experimental branch! For support Neutrino-MP. -Enigma2 channel and satellites list editor for GNU/Linux. -Focused on the convenience of working in lists from the keyboard. -The mouse is also fully supported (Drag and Drop etc) - -Keyboard shortcuts: -Ctrl + X, C, V, Up, Down, PageUp, PageDown, S, T, E, L, H, Space; Insert, Delete, F2. -Insert - copies the selected channels from the main list to the bouquet or inserts (creates) a new bouquet. -Ctrl + X - only in bouquet list. Ctrl + C - only in services list. -Clipboard is "rubber". There is an accumulation before the insertion! -Ctrl + E, F2 - edit/rename. -Ctrl + S, T, E in Satellites edit tool for create and edit satellite or transponder. -Ctrl + L - parental lock. -Ctrl + H - hide/skip. - -Ability to import IPTV into bouquet from m3u files! - -Tests only on OpenPLi based image with GM 990 Spark Reloaded receiver -in my preferred linux distro (Last Linux Mint 18.* - MATE 64-bit)! - -Minimum requirements: Python >= 3.5.2 and GTK+ 3 with PyGObject bindings. - -Terrestrial and cable channels at the moment are not supported! diff --git a/app/ftp.py b/app/ftp.py index 32ad3960..28d2c91a 100644 --- a/app/ftp.py +++ b/app/ftp.py @@ -18,6 +18,7 @@ def download_data(*, properties, download_type=DownloadDataType.ALL): with FTP(host=properties["host"]) as ftp: ftp.login(user=properties["user"], passwd=properties["password"]) save_path = properties["data_dir_path"] + os.makedirs(os.path.dirname(save_path), exist_ok=True) files = [] # bouquets section if download_type is DownloadDataType.ALL or download_type is DownloadDataType.BOUQUETS: diff --git a/app/properties.py b/app/properties.py index 53edb578..1ba064e7 100644 --- a/app/properties.py +++ b/app/properties.py @@ -44,14 +44,14 @@ def get_default_settings(): "services_path": "/etc/enigma2/", "user_bouquet_path": "/etc/enigma2/", "satellites_xml_path": "/etc/tuxbox/", - "data_dir_path": DATA_PATH}, + "data_dir_path": DATA_PATH + "enigma2/"}, Profile.NEUTRINO_MP.value: { "host": "127.0.0.1", "port": "21", "user": "root", "password": "root", "services_path": "/var/tuxbox/config/zapit/", "user_bouquet_path": "/var/tuxbox/config/zapit/", "satellites_xml_path": "/var/tuxbox/config/", - "data_dir_path": DATA_PATH}, + "data_dir_path": DATA_PATH + "neutrino"}, "profile": Profile.ENIGMA_2.value} diff --git a/app/ui/dialogs.py b/app/ui/dialogs.py index 784673d5..46c26238 100644 --- a/app/ui/dialogs.py +++ b/app/ui/dialogs.py @@ -26,7 +26,7 @@ def show_dialog(dialog_type: DialogType, transient, text=None, options=None, act if file_filter is not None: dialog.add_filter(file_filter) - path = options.get(options.get("profile")).get("data_dir_path") + path = options.get("data_dir_path") dialog.set_current_folder(path) response = dialog.run() diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index d212730d..fde5cef3 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -426,10 +426,11 @@ class MainAppWindow: def on_satellite_editor_show(self, model): """ Shows satellites editor dialog """ - show_satellites_dialog(self.__main_window, self.__options) + show_satellites_dialog(self.__main_window, self.__options.get(self.__options.get("profile"))) def on_data_open(self, model): - response = show_dialog(DialogType.CHOOSER, self.__main_window, options=self.__options) + options = self.__options.get(self.__options.get("profile")) + response = show_dialog(DialogType.CHOOSER, self.__main_window, options=options) if response == Gtk.ResponseType.CANCEL: return self.open_data(response) @@ -442,7 +443,8 @@ class MainAppWindow: self.__services_model.clear() self.__blacklist.clear() - data_path = self.__options["data_dir_path"] if data_path is None else data_path + data_path = self.__options.get( + self.__options.get("profile")).get("data_dir_path") if data_path is None else data_path try: self.append_blacklist(data_path) self.append_services(data_path) @@ -491,7 +493,7 @@ class MainAppWindow: if show_dialog(DialogType.QUESTION, self.__main_window) == Gtk.ResponseType.CANCEL: return - path = self.__options["data_dir_path"] + path = self.__options.get(self.__options.get("profile")).get("data_dir_path") bouquets = [] services_model = self.__services_view.get_model() # removing bouquet files @@ -631,7 +633,7 @@ class MainAppWindow: pass def on_download(self, item): - show_download_dialog(self.__main_window, self.__options, self.open_data) + show_download_dialog(self.__main_window, self.__options.get(self.__options.get("profile")), self.open_data) @run_idle def on_view_focus(self, view, focus_event): diff --git a/app/ui/satellites_dialog.py b/app/ui/satellites_dialog.py index 4b9677c8..0c74abba 100644 --- a/app/ui/satellites_dialog.py +++ b/app/ui/satellites_dialog.py @@ -20,7 +20,7 @@ class SatellitesDialog: _aggr = [None for x in range(9)] # aggregate def __init__(self, transient, options): - self._data_path = options.get(options.get("profile")).get("data_dir_path") + "satellites.xml" + self._data_path = options.get("data_dir_path") + "satellites.xml" self._options = options handlers = {"on_open": self.on_open,