paths fix

This commit is contained in:
Dmitriy Yefremov
2017-12-30 22:58:47 +03:00
parent d723ecd7f7
commit 5e954c7ec9
6 changed files with 12 additions and 31 deletions

View File

@@ -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!

View File

@@ -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:

View File

@@ -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}

View File

@@ -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()

View File

@@ -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):

View File

@@ -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,