Compare commits

...

132 Commits

Author SHA1 Message Date
DYefremov
b45dda8ada picon[cz] downloader improvement
* Added caching [as tmp] of the permalinks file.
2026-04-21 01:26:32 +03:00
DYefremov
e1577d8e0c add progressbar style 2026-04-19 22:15:13 +03:00
DYefremov
a184a7cc7f wait dialog style change 2026-04-19 22:10:44 +03:00
DYefremov
6a4ca77009 wait dialog refactoring 2026-04-17 01:14:31 +03:00
DYefremov
c1ed748a91 add custom progress bar class 2026-04-17 00:56:53 +03:00
DYefremov
d6791a9c89 remove warning on satellite page 2026-04-10 10:58:58 +03:00
DYefremov
1f0411fb3d run task -> migrate to Gio [test] 2026-04-09 15:12:17 +03:00
DYefremov
27a1838980 minor playback adjustment
* Changed window behavior for a separate mode.
2026-04-06 22:52:56 +03:00
DYefremov
c1bfb482e1 xmltv reader -> minor cleanup 2026-03-14 17:04:17 +03:00
DYefremov
411e012f5c bg task migration to Gio [test] 2026-03-13 15:51:18 +03:00
DYefremov
a7bc32d7ae xmltv reader -> download adjustment 2026-03-13 15:33:39 +03:00
DYefremov
ef3f69ece1 translations update -> [be, de, ru] 2026-03-03 13:35:26 +03:00
DYefremov
344f4905fc playback setting msg correction 2026-03-03 13:05:13 +03:00
DYefremov
51f36d14ec small refactoring -> [get dialogs string] 2026-03-03 12:21:02 +03:00
DYefremov
f2b31b2ac4 enable editing by double-clicking
* Enabled ability to open the editing dialog by double-clicking in the lists for Bouquets tab.
2026-02-26 13:49:33 +03:00
DYefremov
118734d7fb minor fix for EPG tab settings popover 2026-02-26 11:35:05 +03:00
DYefremov
d7b7f6571b copyright update 2026-02-23 12:10:32 +03:00
DYefremov
9728843b0a msg adjustment 2026-02-23 12:09:50 +03:00
DYefremov
033ac70c8a minor adjustment of favorites remove 2026-02-22 19:19:38 +03:00
DYefremov
85247e8307 version update -> 3.14.4 2026-02-22 16:49:06 +03:00
DYefremov
d38a896685 service edit dialog improvement
* Auto set the namespace value when the satellite position changes.
2026-02-22 15:53:25 +03:00
DYefremov
880908c163 service dialog refactoring 2026-02-22 15:14:32 +03:00
DYefremov
ec94d5ef46 fix creation transponder data for a new channel 2026-02-22 14:27:20 +03:00
DYefremov
49f9863922 version update -> 3.14.3 2026-02-18 16:19:04 +03:00
DYefremov
6d4249cf1e add *.patch for win build 2026-02-18 16:14:02 +03:00
DYefremov
0fc0ef1d3e win build start file update 2026-02-18 15:48:40 +03:00
DYefremov
c587f2bcdc win build logo update 2026-02-18 15:46:17 +03:00
DYefremov
5cd8c68589 add splash screen to win build 2026-02-15 22:37:16 +03:00
DYefremov
61690db0ee minor msg adjustment 2026-02-15 21:50:07 +03:00
DYefremov
fcc2b6b6a8 add app termination
* Added app termination while background tasks are still running.
2026-02-15 13:48:26 +03:00
DYefremov
a5412cd2b3 refactoring of keyboard key handling 2026-02-14 12:58:13 +03:00
DYefremov
a47a7417c2 remove favs refactoring 2026-02-14 10:08:09 +03:00
DYefremov
bdac77e88c picons downloader improvement
* Added subprocess creationflags.
2026-02-02 15:19:01 +03:00
DYefremov
8ab79a2937 *.spec files adjustment 2026-02-01 23:51:17 +03:00
DYefremov
8dc880577f bootlogo manager improvements
* Added subprocess flags to improve startup on Windows.
2026-01-31 12:38:13 +03:00
DYefremov
b1829651d3 it *.mo file update 2026-01-30 20:35:10 +03:00
mapi68
7339872de6 translations update -> it (#239) 2026-01-30 20:33:23 +03:00
DYefremov
8155643098 version update -> 3.14.2 2026-01-26 22:27:21 +03:00
audi06_19
87a1cde859 translations update -> tr (#237) 2026-01-25 18:08:04 +03:00
DYefremov
a591d31d01 translations update -> [be, de, ru] 2026-01-18 22:16:34 +03:00
DYefremov
e863c41117 minor fix 2026-01-18 21:55:26 +03:00
DYefremov
811539ae19 enable extension manager permanently 2026-01-18 16:09:21 +03:00
DYefremov
bc7327a6d5 extension manager adjustment 2026-01-11 00:27:43 +03:00
DYefremov
0c114964f2 fav channels numbering adjustment (#236) 2026-01-01 12:36:16 +03:00
DYefremov
b8a3e5e4c1 *.spec files adjustment 2025-11-15 12:21:14 +03:00
DYefremov
1d16e9e220 version update -> 3.14.1 2025-11-14 13:25:02 +03:00
DYefremov
c96b464cbc prevent double data loading
* Fixes double data loading when opening an external folder from the start page.
2025-11-14 13:22:51 +03:00
DYefremov
43821e6f50 add t2mi pid value support (#232) 2025-11-10 11:56:53 +03:00
DYefremov
e0e642db5a sk *.mo file update 2025-11-10 09:11:06 +03:00
EnoSat
2266fd4d3d Slovak translations update (#234) 2025-11-10 09:09:14 +03:00
EnoSat
6b8145c674 Add Slovak translations to desktop entry (#233) 2025-11-09 21:07:50 +03:00
DYefremov
fa89ab8608 add Slovak translation 2025-11-09 19:32:04 +03:00
EnoSat
da70b0fb18 Slovak language (#231)
Added Slovak localization.
2025-11-09 18:57:38 +03:00
DYefremov
6932465cfd version update -> 3.14.0 2025-11-02 12:08:58 +03:00
DYefremov
303fe0b1ae README update 2025-11-02 11:14:38 +03:00
DYefremov
f8dec3140c add data loading progress update 2025-11-02 11:08:59 +03:00
DYefremov
60e1e4f5e6 migration to the progress bar on data load
* It fixes long data loading on some configs.
2025-11-02 10:28:21 +03:00
DYefremov
a99d6e26db small refactoring of data update 2025-11-02 09:35:29 +03:00
DYefremov
ecf5b6399c yt-dlp init adjustment 2025-11-01 17:07:53 +03:00
DYefremov
3c04a00230 adjust getting yt icon 2025-10-08 21:35:42 +03:00
DYefremov
527a52c87b enable keep of extracted data 2025-10-01 23:22:57 +03:00
DYefremov
4bcd126947 add upload bouquets func 2025-10-01 13:56:46 +03:00
DYefremov
1a3617a6d4 improved service status bar
* Added current datta path display.
2025-09-27 15:50:50 +03:00
DYefremov
d6d7b105ec enabled data saving for ext path 2025-09-27 09:27:49 +03:00
DYefremov
eab34c5ecc small ui adjustment 2025-09-27 09:25:08 +03:00
DYefremov
3cef063aa4 upload adjustment 2025-09-26 22:09:13 +03:00
DYefremov
958320e573 separated data upload for the services tab 2025-09-23 13:13:10 +03:00
DYefremov
394b7c4c01 separated data load/upload for the satellite tab 2025-09-21 13:44:20 +03:00
DYefremov
00f492b0a2 enable multiple selection for tc views 2025-09-21 13:35:36 +03:00
DYefremov
0e0abdcf8e kos web source adjustment 2025-09-10 00:34:41 +03:00
DYefremov
037b917d3e it *.mo file update 2025-08-30 12:42:38 +03:00
mapi68
0bc85cb5fa Italian translation update (#230) 2025-08-30 12:39:56 +03:00
DYefremov
8bf6427bbd enabled data transfer from ext path 2025-08-30 00:09:31 +03:00
audi06_19
f85c1d2e0d Turkish translation update (#229) 2025-08-25 20:16:46 +03:00
DYefremov
03e2fc96ec add tooltip 2025-08-22 09:51:26 +03:00
DYefremov
f0d58c0fb4 translations update -> [be, de, ru] 2025-08-22 09:47:06 +03:00
DYefremov
1fc10f0119 add scroll to new added channel 2025-08-19 23:53:07 +03:00
DYefremov
a21f6faab2 add support for creating terrestrial and cable channels 2025-08-19 23:33:56 +03:00
DYefremov
d78cee1241 enable support for creating a new channel 2025-08-18 14:20:14 +03:00
DYefremov
145bd75776 fix internal yt client 2025-08-18 10:36:13 +03:00
DYefremov
6765fd5db7 version update -> 3.13.2 2025-08-07 22:02:38 +03:00
DYefremov
53616f95b0 сhanged output of XMLTV file loading progress
* Fixes XMLTV file loading for Windows build.
2025-08-07 21:18:59 +03:00
DYefremov
137b5acde5 BUILD_WIN.md update 2025-08-07 20:28:00 +03:00
DYefremov
17f705a4e3 it *.mo file update 2025-08-05 19:37:09 +03:00
mapi68
d68a215e2a Update Italian language (#227) 2025-08-05 19:34:03 +03:00
audi06_19
d8f67380e5 Turkish translation update (#226) 2025-08-04 07:52:53 +03:00
DYefremov
9965f3e3a5 version update -> 3.13.1 2025-08-02 10:03:15 +03:00
DYefremov
2bb0faa19e enabled delete key for alternatives 2025-08-02 09:56:53 +03:00
DYefremov
9c5cf8cebb add paste menu item for alternatives 2025-08-01 22:17:19 +03:00
DYefremov
fb20e82572 enabled paste from buffer for alternatives 2025-08-01 09:33:36 +03:00
DYefremov
ffdf5d8ce2 translations update -> [be, de, ru] 2025-07-31 00:01:57 +03:00
DYefremov
8b6f860459 add warning message
* Added warning message about errors when loading bouquets.
2025-07-30 22:26:56 +03:00
DYefremov
c747cf1275 add error counting during bouquets loading 2025-07-30 22:02:02 +03:00
DYefremov
7a71ebd188 loading bouquets refactoring
* Added data loading error skipping if bouquet file is missing.
2025-07-30 20:48:43 +03:00
DYefremov
c4847766bb enabled dnd from IPTV list to alternatives 2025-07-28 17:19:02 +03:00
DYefremov
73a611dc3c alternatives improvement
* Added display of IPTV services.
2025-07-28 00:35:06 +03:00
DYefremov
ef931bcd75 copyright update 2025-06-03 20:21:26 +03:00
DYefremov
f173587dab bootlogo manager improvement
* Added custom STB path setting.
2025-05-31 23:30:02 +03:00
DYefremov
9a0b362b91 telnetlib usage refactoring (#218) 2025-05-30 15:59:26 +03:00
DYefremov
51acb171d5 it *.mo file update 2025-05-16 12:37:44 +03:00
mapi68
b57adb43ba Italian translation update (#225)
* Add files via upload

* Add files via upload

* correct typo
2025-05-16 12:35:13 +03:00
audi06_19
bcea538c4e Turkish translation update (#224) 2025-05-11 21:34:35 +03:00
DYefremov
77281271c8 minor improvement
* Enabled name cache for multiepg mode.
2025-05-06 09:50:10 +03:00
DYefremov
5c94912f21 version update -> 3.13.0 2025-05-03 16:22:55 +03:00
DYefremov
e8f33cbee9 translations update -> [be, de, ru] 2025-05-02 18:49:01 +03:00
DYefremov
aa2b06ea27 add filtering by coding presence 2025-05-02 16:16:05 +03:00
DYefremov
5576bd8112 enabled custom ports (#221)
*  Enabled custom ports for FTP and Telnet.
2025-04-29 22:12:26 +03:00
DYefremov
551c9d5722 connection test adjustment 2025-04-29 21:45:57 +03:00
DYefremov
f6518f1ee5 enabled port values checking 2025-04-29 21:09:19 +03:00
DYefremov
20b534f723 changed type for ports 2025-04-29 21:07:10 +03:00
Thorsten Klein
82a954e1a4 Accept if lines in lamedb do not start with provider (p:) (#223)
* Accept if lines in `lamedb` do not start with provider (`p:`)

* minor adjustment
2025-04-28 22:42:21 +03:00
DYefremov
67446f0898 cas info display adjustment 2025-03-15 11:56:02 +03:00
DYefremov
39a092cb57 add cas value 2025-03-15 11:54:17 +03:00
DYefremov
4d81937779 it *.mo file update 2025-02-11 08:18:50 +03:00
audi06_19
68dc48cdbe Turkish translation update (#220) 2025-02-11 08:16:09 +03:00
mapi68
1a6be14949 translation update -> [it] (#219) 2025-02-11 08:15:47 +03:00
DYefremov
7295ec90c0 translations update -> [be, de, ru] 2025-02-08 21:25:30 +03:00
DYefremov
3a98b497c8 fix save of *.xml path changes (#217) 2025-01-21 11:43:34 +03:00
DYefremov
12bb1f0601 minor correction for EPG dialog 2025-01-19 22:25:40 +03:00
DYefremov
eebe953ac2 markers reading adjustment 2025-01-12 19:53:58 +03:00
DYefremov
741bea29e6 enabled additional name cache for EPG (#189) 2025-01-05 18:13:50 +03:00
DYefremov
97041e5799 name cache init 2025-01-04 00:58:42 +03:00
DYefremov
5ee4e18346 add EPG name cache option 2025-01-03 22:38:43 +03:00
DYefremov
de508fbfc2 add "tvg-id" parsing for *.m3u import 2025-01-02 13:06:08 +03:00
DYefremov
36aebe7f19 add deep name comparing for EPG dialog (#209) 2024-12-27 00:26:13 +03:00
DYefremov
5ac9053944 version update -> 3.12.0 2024-12-19 00:42:43 +03:00
DYefremov
ce6819d539 file naming for oscam picon converter 2024-12-19 00:38:55 +03:00
DYefremov
b13c2f321c path init for picon converter 2024-12-18 21:05:36 +03:00
DYefremov
015b6b1ccd bootlogo fmt change 2024-12-07 14:31:39 +03:00
DYefremov
911279ce09 basic support for converting to *.tpl 2024-12-05 18:06:57 +03:00
DYefremov
71ddd12541 improved picon conversion tab
* conversion for the selected bouquet
  * oscam picons ui prototype
2024-12-02 23:20:20 +03:00
DYefremov
4867b1b648 picon tab refactoring 2024-12-01 16:02:42 +03:00
66 changed files with 3913 additions and 905 deletions

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018-2023 Dmitriy Yefremov
Copyright (c) 2018-2026 Dmitriy Yefremov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -106,9 +106,7 @@ Support for DVB-T/T2 and DVB-C channels for Neutrino is not fully implemented an
Main supported *lamedb* format is version **4**. Versions **3** and **5** has only **experimental** support! For version **3** is only read mode available. When saving, version **4** format is used instead.
When using the multiple import feature, from *lamedb* will be taken data **only for channels that are in the selected bouquets!**
If you need full set of the data, including *[satellites, terrestrial, cables].xml* (current files will be overwritten),
just load your data via *"File/Open"* and press *"Save"*. When importing separate bouquet files, only those services
(excluding IPTV) that are in the **current open lamedb** (main list of services) will be imported.
When importing separate bouquet files, only those services (excluding IPTV) that are in the **current open lamedb** (main list of services) will be imported.
**The built-in Telnet client does not support ANSI escape sequences!**

View File

@@ -1,9 +1,38 @@
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Author: Dmitriy Yefremov <https://github.com/DYefremov>
#
import logging
from collections import defaultdict
from functools import wraps
from threading import Thread, Timer
from threading import Timer
from gi.repository import GLib
from gi.repository.Gio import Task
_LOG_FILE = "demon-editor.log"
LOG_DATE_FORMAT = "%d-%m-%y %H:%M:%S"
@@ -41,12 +70,12 @@ def run_idle(func):
def run_task(func):
""" Runs function in separate thread """
""" Runs a function in a separate thread. """
@wraps(func)
def wrapper(*args, **kwargs):
task = Thread(target=func, args=args, kwargs=kwargs, daemon=True)
task.start()
task = Task()
task.run_in_thread(lambda t, s, d, c: func(*args, **kwargs))
return wrapper

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -28,15 +28,15 @@
import os
import re
import selectors
import socket
import time
import urllib
import xml.etree.ElementTree as ETree
from enum import Enum
from ftplib import FTP, CRLF, Error, all_errors
from ftplib import FTP, FTP_PORT, CRLF, Error, all_errors
from http.client import RemoteDisconnected
from pathlib import Path
from telnetlib import Telnet
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode, quote
from urllib.request import (urlopen, HTTPPasswordMgrWithDefaultRealm, HTTPBasicAuthHandler, build_opener,
@@ -78,9 +78,66 @@ class HttpApiException(Exception):
pass
class StubTelnet:
""" Stub class for Telnet.
Used to run a program on an OS with Python >= 3.13
without the need to install telnetlib .
-> https://github.com/DYefremov/DemonEditor/issues/218.
"""
def __init__(self, **kwargs):
self._msg = "Please (re)install [telnetlib] module. -> [https://github.com/DYefremov/DemonEditor/issues/218]"
log(self._msg)
def read_until(self, match, timeout=None):
raise TestException(self._msg)
TN = StubTelnet
try:
from telnetlib import Telnet
except ModuleNotFoundError as e:
log(e)
else:
TN = Telnet
class ExtTelnet(TN):
def __init__(self, output_callback=None, **kwargs):
super().__init__(**kwargs)
self._output_callback = output_callback
def interact(self):
""" Interaction function, emulates a very dumb telnet client. """
with selectors.DefaultSelector() as selector:
selector.register(self, selectors.EVENT_READ)
while True:
for key, events in selector.select():
if key.fileobj is self:
try:
text = self.read_very_eager()
except EOFError as e:
msg = "\n*** Connection closed by remote host ***\n"
if self._output_callback:
self._output_callback(msg)
log(msg)
raise e
else:
if text and self._output_callback:
self._output_callback(text)
class UtfFTP(FTP):
""" FTP class wrapper. """
def __init__(self, *, host="", port=FTP_PORT, user="", passwd="", **kwargs):
self.port = port
super().__init__(host, user, passwd, **kwargs)
def retrlines(self, cmd, callback=None):
""" Small modification of the original method.
@@ -372,7 +429,7 @@ class UtfFTP(FTP):
def download_data(*, settings, download_type=DownloadType.ALL, callback=log, files_filter=None):
with UtfFTP(host=settings.host, user=settings.user, passwd=settings.password) as ftp:
with UtfFTP(host=settings.host, port=settings.port, user=settings.user, passwd=settings.password) as ftp:
ftp.encoding = "utf-8"
callback("FTP OK.")
save_path = settings.profile_data_path
@@ -386,7 +443,7 @@ def download_data(*, settings, download_type=DownloadType.ALL, callback=log, fil
ftp.download_files(save_path, file_list, callback)
# *.xml and webtv
if download_type in (DownloadType.ALL, DownloadType.SATELLITES):
ftp.download_xml(save_path, settings.satellites_xml_path, STC_XML_FILE, callback)
ftp.download_xml(save_path, settings.satellites_xml_path, files_filter or STC_XML_FILE, callback)
if download_type in (DownloadType.ALL, DownloadType.WEBTV):
ftp.download_xml(save_path, settings.satellites_xml_path, WEB_TV_XML_FILE, callback)
@@ -403,16 +460,17 @@ def download_data(*, settings, download_type=DownloadType.ALL, callback=log, fil
def upload_data(*, settings, download_type=DownloadType.ALL, callback=log, done_callback=None,
files_filter=None, ext_host=None):
files_filter=None, ext_host=None, ext_path=None):
s_type = settings.setting_type
use_http = s_type is SettingsType.ENIGMA_2 and settings.use_http
data_path = settings.profile_data_path
host, port, use_ssl = ext_host or settings.host, settings.http_port, settings.http_use_ssl
user, password = settings.user, settings.password
base_url = f"http{'s' if use_ssl else ''}://{host}:{port}"
base = "web" if s_type is SettingsType.ENIGMA_2 else "control"
url = f"{base_url}/{base}/"
tn, ht = None, None # Telnet, HTTP.
ftp_port, telnet_port = settings.port, settings.telnet_port
data_path = ext_path or settings.profile_data_path
try:
use_http = use_http and test_http(host, port, user, password, use_ssl=use_ssl, skip_message=True, s_type=s_type)
@@ -441,21 +499,21 @@ def upload_data(*, settings, download_type=DownloadType.ALL, callback=log, done_
else:
if download_type is not DownloadType.PICONS:
# Telnet
tn = telnet(host=host, user=user, password=password, timeout=settings.telnet_timeout)
tn = telnet(host=host, port=telnet_port, user=user, password=password, timeout=settings.telnet_timeout)
next(tn)
# Terminate Enigma2 or Neutrino.
callback("Telnet initialization ...")
tn.send("init 4")
callback("Stopping GUI...")
with UtfFTP(host=host, user=user, passwd=password) as ftp:
with UtfFTP(host=host, port=ftp_port, user=user, passwd=password) as ftp:
ftp.encoding = "utf-8"
callback("FTP OK.")
sat_xml_path = settings.satellites_xml_path
services_path = settings.services_path
if download_type is DownloadType.SATELLITES:
ftp.upload_xml(data_path, sat_xml_path, STC_XML_FILE, callback)
ftp.upload_xml(data_path, sat_xml_path, files_filter or STC_XML_FILE, callback)
if s_type is SettingsType.NEUTRINO_MP and download_type is DownloadType.WEBTV:
ftp.upload_xml(data_path, sat_xml_path, WEB_TV_XML_FILE, callback)
@@ -466,7 +524,7 @@ def upload_data(*, settings, download_type=DownloadType.ALL, callback=log, done_
if download_type is DownloadType.ALL or download_type is DownloadType.SERVICES:
if download_type is DownloadType.ALL:
ftp.upload_xml(data_path, sat_xml_path, STC_XML_FILE, callback)
ftp.upload_xml(data_path, sat_xml_path, files_filter or STC_XML_FILE, callback)
if s_type is SettingsType.NEUTRINO_MP:
ftp.upload_xml(data_path, sat_xml_path, WEB_TV_XML_FILE, callback)
@@ -506,7 +564,8 @@ def upload_data(*, settings, download_type=DownloadType.ALL, callback=log, done_
if compress:
if not tn:
callback("Telnet initialization...")
tn = telnet(host=host, user=user, password=password, timeout=settings.telnet_timeout)
tn = telnet(host=host, port=telnet_port, user=user, password=password,
timeout=settings.telnet_timeout)
next(tn)
callback("Extracting...")
@@ -529,7 +588,7 @@ def upload_data(*, settings, download_type=DownloadType.ALL, callback=log, done_
ht.send((f"{url}servicelistreload?mode=2", "Reloading Userbouquets."))
elif download_type is DownloadType.ALL or download_type is DownloadType.SERVICES:
ht.send((f"{url}servicelistreload?mode=0", "Reloading lamedb and Userbouquets."))
time.sleep(1)
time.sleep(2)
ht.send((f"{url}servicelistreload?mode=4", "Updating parental control."))
if not settings.keep_power_mode:
ht.send((f"{url}powerstate?newstate=4", "Wakeup from Standby."))
@@ -555,7 +614,7 @@ def get_upload_info_message(download_type):
elif download_type is DownloadType.ALL:
return "All user data will be reloaded!"
elif download_type is DownloadType.SATELLITES:
return "Satellites.xml file will be updated!"
return "*.xml file will be updated!"
elif download_type is DownloadType.PICONS:
return "Picons will be updated!"
return ""
@@ -591,7 +650,7 @@ def http(user, password, url, callback, use_ssl=False, s_type=SettingsType.ENIGM
def telnet(host, port=23, user="", password="", timeout=5):
try:
tn = Telnet(host=host, port=port, timeout=timeout)
tn = ExtTelnet(host=host, port=port, timeout=timeout)
except socket.timeout:
log("telnet error: socket timeout")
else:
@@ -895,7 +954,7 @@ class HttpAPI:
def test_ftp(host, port, user, password, timeout=5):
try:
with FTP(host=host, user=user, passwd=password, timeout=timeout) as ftp:
with UtfFTP(host=host, port=port, user=user, passwd=password, timeout=timeout) as ftp:
return ftp.getwelcome()
except all_errors as e:
raise TestException(e)
@@ -942,7 +1001,7 @@ def test_telnet(host, port, user, password, timeout=5):
def telnet_test(host, port, user, password, timeout):
tn = Telnet(host=host, port=port, timeout=timeout)
tn = ExtTelnet(host=host, port=port, timeout=timeout)
time.sleep(1)
tn.read_until(b"login: ", timeout=2)
tn.write(user.encode("utf-8") + b"\r")

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2023 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -38,10 +38,9 @@ from .satxml import get_satellites, write_satellites
def get_services(data_path, s_type, format_version):
if s_type is SettingsType.ENIGMA_2:
return get_enigma_services(data_path, format_version)
elif s_type is SettingsType.NEUTRINO_MP:
if s_type is SettingsType.NEUTRINO_MP:
return get_neutrino_services(data_path)
return get_enigma_services(data_path, format_version)
@run_task
@@ -53,10 +52,11 @@ def write_services(path, channels, s_type, format_version):
def get_bouquets(path, s_type):
if s_type is SettingsType.ENIGMA_2:
return BouquetsReader(path).get()
elif s_type is SettingsType.NEUTRINO_MP:
return get_neutrino_bouquets(path)
if s_type is SettingsType.NEUTRINO_MP:
return get_neutrino_bouquets(path), 0
reader = BouquetsReader(path)
return reader.get(), reader.errors
def write_bouquet(path, bq, s_type):

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2022 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -64,7 +64,7 @@ Terrestrial = namedtuple("Terrestrial", ["name", "flags", "countrycode", "transp
Cable = namedtuple("Cable", ["name", "flags", "satfeed", "countrycode", "transponders"])
Transponder = namedtuple("Transponder", ["frequency", "symbol_rate", "polarization", "fec_inner", "system",
"modulation", "pls_mode", "pls_code", "is_id", "t2mi_plp_id"])
"modulation", "pls_mode", "pls_code", "is_id", "t2mi_plp_id", "t2mi_pid"])
TerTransponder = namedtuple("TerTransponder", ["centre_frequency", "system", "bandwidth", "constellation",
"code_rate_hp", "code_rate_lp", "guard_interval", "transmission_mode",
"hierarchy_information", "inversion", "plp_id"])
@@ -72,12 +72,16 @@ CableTransponder = namedtuple("CableTransponder", ["frequency", "symbol_rate", "
class TrType(Enum):
""" Transponders type """
""" Transponders type. """
Satellite = "s"
Terrestrial = "t"
Cable = "c"
ATSC = "a"
@classmethod
def _missing_(cls, value):
return cls.Satellite
class BqType(Enum):
""" Bouquet type. """
@@ -225,7 +229,8 @@ A_MODULATION = {"0": "Auto", "1": "QAM16", "2": "QAM32", "3": "QAM64", "4": "QAM
# CAS
CAS = {"C:26": "BISS", "C:0B": "Conax", "C:06": "Irdeto", "C:18": "Nagravision", "C:05": "Viaccess", "C:01": "SECA",
"C:0E": "PowerVu", "C:4A": "DRE-Crypt", "C:7B": "DRE-Crypt", "C:56": "Verimatrix", "C:09": "VideoGuard"}
"C:0E": "PowerVu", "C:4A": "DRE-Crypt", "C:7B": "DRE-Crypt", "C:56": "Verimatrix", "C:09": "VideoGuard",
"C:4AFC": "Panaccess"}
# 'on' attribute 0070(hex) = 112(int) = ONID(ONID-TID on www.lyngsat.com)
PROVIDER = {112: "HTB+", 253: "Tricolor TV"}

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -27,6 +27,7 @@
""" Module for working with Enigma2 bouquets. """
import os.path
import re
from collections import Counter
from enum import Enum
@@ -41,6 +42,24 @@ _DEFAULT_BOUQUET_NAME = "favourites"
_MARKER_PREFIX = "[MARKER!] "
class ServiceType(Enum):
SERVICE = "0"
BOUQUET = "7" # Sub bouquet.
MARKER = "64"
SPACE = "832"
ALT = "134" # Alternatives.
UDP = "256"
HIDDEN = "519" # Skip, hide.
@classmethod
def _missing_(cls, value):
log("Error. No matching service type [{} {}] was found.".format(cls.__name__, value))
return cls.SERVICE
def __str__(self):
return self.value
class BouquetsWriter:
""" Class for creating and writing bouquet files.
@@ -159,24 +178,6 @@ class BouquetsWriter:
file.writelines(bouquet)
class ServiceType(Enum):
SERVICE = "0"
BOUQUET = "7" # Sub bouquet.
MARKER = "64"
SPACE = "832"
ALT = "134" # Alternatives.
UDP = "256"
HIDDEN = "519" # Skip, hide.
@classmethod
def _missing_(cls, value):
log("Error. No matching service type [{} {}] was found.".format(cls.__name__, value))
return cls.SERVICE
def __str__(self):
return self.value
class BouquetsReader:
""" Class for reading and parsing bouquets. """
_BQ_PAT = re.compile(r".*FROM BOUQUET\s+\"((.*bouquet|alternatives)?\.?([\w-]+)\.?(\w+)?)\"\s+.*$", re.IGNORECASE)
@@ -184,10 +185,15 @@ class BouquetsReader:
_BQ_POST_PAT = re.compile(r".*FROM BOUQUET\s+\"((.*bouquet|alternatives)?\.?(.*)\.?(\w+)?)\"\s+.*$", re.IGNORECASE)
_STREAM_TYPES = {"4097", "5001", "5002", "8193", "8739"}
__slots__ = ["_path"]
__slots__ = ["_path", "_errors"]
def __init__(self, path):
def __init__(self, path=""):
self._path = path
self._errors = 0
@property
def errors(self):
return self._errors
def get(self):
""" Returns a tuple of TV and Radio bouquets. """
@@ -199,6 +205,7 @@ class BouquetsReader:
_, _, bqs_name = line.partition("#NAME")
if not bqs_name:
log(f"No bouquets name found in '{bq_name}'")
self._errors += 1
bqs_name = "Bouquets (TV)" if bq_type == BqType.TV.value else "Bouquets (Radio)"
bouquets = Bouquets(bqs_name.strip(), bq_type, [])
@@ -248,21 +255,30 @@ class BouquetsReader:
bouquets[2].append(Bouquet(b_name, BqType.MARKER.value, [], None, None, line.strip()))
else:
log(f"Unsupported or invalid data format: [{line}].")
self._errors += 1
else:
log(f"Unsupported or invalid line format: [{line}].")
self._errors += 1
return bouquets
@staticmethod
def get_bouquet(path, f_name, bq_name):
def get_bouquet(self, path, f_name, bq_name):
""" Parsing services ids from bouquet file. """
with open(f"{path}{f_name}", encoding="utf-8", errors="replace") as file:
bq_file = f"{path}{f_name}"
services = []
if not os.path.isfile(bq_file):
log(f"Bouquet reading error: No such bouquet [{bq_name}] file -> '{f_name}'.")
self._errors += 1
return f"! -> {bq_name}", services
with open(bq_file, encoding="utf-8", errors="replace") as file:
chs_list = file.read()
services = []
srvs = list(filter(None, chs_list.split("\n#SERVICE"))) # filtering ['']
# May come across empty[wrong] files!
if not srvs:
log(f"Bouquet file '{f_name}' is empty or wrong!")
self._errors += 1
return f"{bq_name} [empty]", services
bq_name = srvs.pop(0)
@@ -272,29 +288,30 @@ class BouquetsReader:
data_len = len(srv_data)
if data_len < 10:
log(f"The bouquet [{bq_name}] service [{num}] has the wrong data format: [{srv}]")
self._errors += 1
continue
s_type = ServiceType(srv_data[1])
if s_type is ServiceType.MARKER:
m_data, sep, desc = srv.partition("#DESCRIPTION")
services.append(BouquetService(desc.strip() if desc else "", BqServiceType.MARKER, srv, num))
m_data, sep, desc = srv_data[-1].partition("#DESCRIPTION")
services.append(BouquetService(desc.strip() if desc else m_data, BqServiceType.MARKER, srv, num))
elif s_type is ServiceType.SPACE:
m_data, sep, desc = srv.partition("#DESCRIPTION")
services.append(BouquetService(desc.strip() if desc else "", BqServiceType.SPACE, srv, num))
elif s_type is ServiceType.ALT:
alt = re.match(BouquetsReader._BQ_PAT, srv)
alt = re.match(self._BQ_PAT, srv)
if alt:
af_name, alt_name = alt.group(1), alt.group(3)
alt_bq_name, alt_srvs = BouquetsReader.get_bouquet(path, af_name, alt_name)
alt_bq_name, alt_srvs = self.get_bouquet(path, af_name, alt_name)
services.append(BouquetService(alt_bq_name, BqServiceType.ALT, alt_name, tuple(alt_srvs)))
elif s_type is ServiceType.BOUQUET:
sub = re.match(BouquetsReader._BQ_PAT, srv)
sub = re.match(self._BQ_PAT, srv)
if sub:
sf_name, sub_name, sub_type = sub.group(1), sub.group(3), sub.group(4)
sub_bq_name, sub_srvs = BouquetsReader.get_bouquet(path, sf_name, sub_name)
sub_bq_name, sub_srvs = self.get_bouquet(path, sf_name, sub_name)
bq = Bouquet(sub_bq_name, sub_type, tuple(sub_srvs), None, None, sf_name)
services.append(BouquetService(sub_bq_name, BqServiceType.BOUQUET, bq, num))
elif srv_data[0].strip() in BouquetsReader._STREAM_TYPES or srv_data[10].startswith(("http", "rtsp")):
elif srv_data[0].strip() in self._STREAM_TYPES or srv_data[10].startswith(("http", "rtsp")):
stream_data, sep, desc = srv.partition("#DESCRIPTION")
desc = desc.lstrip(":").strip() if desc else srv_data[-1].strip()
services.append(BouquetService(desc, BqServiceType.IPTV, srv, num))

View File

@@ -293,7 +293,8 @@ class LameDbReader:
i += 1
tmp.append(line)
if i == size:
if not line.startswith("p:"):
# check if provider (p:) is present in line
if "p:" not in line:
# To prevent cases of incorrect service data formation
# (e.g. the name contains a line break)
tmp.pop()

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -44,6 +44,7 @@ PICON_FORMAT = "{}_{}_{:X}_{:X}_{:X}_{:X}_{:X}_0_0_0.png"
ENCODING_BLACKLIST = {"MacRoman"}
class StreamType(Enum):
DVB_TS = "1"
NONE_TS = "4097"
@@ -101,6 +102,7 @@ def parse_m3u(path, s_type, detect_encoding=True, params=None):
data = dict(pattern.findall(line))
name = data.get("tvg-name", name)
picon = data.get("tvg-logo", None)
epg_id = data.get("tvg-id", None)
if s_type is SettingsType.ENIGMA_2:
group = data.get("group-title", None)
@@ -111,6 +113,7 @@ def parse_m3u(path, s_type, detect_encoding=True, params=None):
params[0] = sid_counter
sid_counter += 1
fav_id = get_fav_id(url, name, s_type, params)
if s_type is SettingsType.ENIGMA_2:
p_id = get_picon_id(params)
if group not in groups:
@@ -122,7 +125,7 @@ def parse_m3u(path, s_type, detect_encoding=True, params=None):
services.append(Service(None, None, None, group, *aggr[0:3], m_name, *aggr, m_id, None))
if all((name, url, fav_id)):
services.append(Service(None, None, IPTV_ICON, name, *aggr[0:2], group,
services.append(Service(epg_id, None, IPTV_ICON, name, *aggr[0:2], group,
st, picon, p_id, *s_aggr, url, fav_id, None))
else:
log(f"*.m3u* parse error ['{path}']: name[{name}], url[{url}], fav id[{fav_id}]")

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2023 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -88,7 +88,8 @@ def get_sat_transponders(elem):
e.get("pls_mode", None),
e.get("pls_code", None),
e.get("is_id", None),
e.get("t2mi_plp_id", None)) for e in elem.iter("transponder")]
e.get("t2mi_plp_id", None),
e.get("t2mi_pid", None)) for e in elem.iter("transponder")]
def get_terrestrial(path):

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2023 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -56,9 +56,9 @@ class Defaults:
USER = "root"
PASSWORD = ""
HOST = "127.0.0.1"
FTP_PORT = "21"
HTTP_PORT = "80"
TELNET_PORT = "23"
FTP_PORT = 21
HTTP_PORT = 80
TELNET_PORT = 23
HTTP_USE_SSL = False
# Enigma2.
BOX_SERVICES_PATH = "/etc/enigma2/"
@@ -305,11 +305,11 @@ class Settings:
self._cp_settings["hosts"] = value
@property
def port(self):
return self._cp_settings.get("port", self.get_default("port"))
def port(self) -> int:
return int(self._cp_settings.get("port", self.get_default("port")))
@port.setter
def port(self, value):
def port(self, value: int):
self._cp_settings["port"] = value
@property
@@ -329,19 +329,19 @@ class Settings:
self._cp_settings["password"] = value
@property
def http_port(self):
return self._cp_settings.get("http_port", self.get_default("http_port"))
def http_port(self) -> int:
return int(self._cp_settings.get("http_port", self.get_default("http_port")))
@http_port.setter
def http_port(self, value):
def http_port(self, value: int):
self._cp_settings["http_port"] = value
@property
def http_timeout(self):
def http_timeout(self) -> int:
return self._cp_settings.get("http_timeout", self.get_default("http_timeout"))
@http_timeout.setter
def http_timeout(self, value):
def http_timeout(self, value: int):
self._cp_settings["http_timeout"] = value
@property
@@ -353,11 +353,11 @@ class Settings:
self._cp_settings["http_use_ssl"] = value
@property
def telnet_port(self):
return self._cp_settings.get("telnet_port", self.get_default("telnet_port"))
def telnet_port(self) -> int:
return int(self._cp_settings.get("telnet_port", self.get_default("telnet_port")))
@telnet_port.setter
def telnet_port(self, value):
def telnet_port(self, value: int):
self._cp_settings["telnet_port"] = value
@property
@@ -604,6 +604,15 @@ class Settings:
def epg_xml_sources(self, value):
self._cp_settings["epg_xml_sources"] = value
@property
def enable_epg_name_cache(self):
""" Enables additional name cache for EPG. """
return self._settings.get("enable_epg_name_cache", False)
@enable_epg_name_cache.setter
def enable_epg_name_cache(self, value):
self._settings["enable_epg_name_cache"] = value
# *********** FTP ************ #
@property

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2023 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,6 @@ import os
import re
import shutil
import struct
import sys
import xml.etree.ElementTree as ET
from collections import namedtuple, defaultdict
from datetime import datetime, timezone
@@ -258,61 +257,64 @@ class XmlTvReader(Reader):
log(f"{self.__class__.__name__} [download] error: Invalid URL {self._url}")
return
with requests.get(url=self._url, stream=True) as resp:
if resp.reason == "OK":
suf = self._url[self._url.rfind("."):]
if suf not in self.SUFFIXES:
log(f"{self.__class__.__name__} [download] error: Unsupported file extension.")
return
try:
with requests.get(url=self._url, stream=True, timeout=(5, 5)) as resp:
if resp.reason == "OK":
suf = self._url[self._url.rfind("."):]
if suf not in self.SUFFIXES:
log(f"{self.__class__.__name__} [download] error: Unsupported file extension.")
return
data_size = resp.headers.get("content-length")
if not data_size:
log(f"{self.__class__.__name__} [download *.{suf}] error: Error getting data size.")
if clb:
clb()
return
data_size = resp.headers.get("content-length")
if not data_size:
log(f"{self.__class__.__name__} [download *.{suf}] error: Error getting data size.")
return
with NamedTemporaryFile(suffix=suf, delete=not IS_WIN) as tf:
downloaded = 0
data_size = int(data_size)
log("Downloading XMLTV file...")
for data in resp.iter_content(chunk_size=1024):
downloaded += len(data)
tf.write(data)
done = int(50 * downloaded / data_size)
sys.stdout.write(f"\rDownloading XMLTV file [{'=' * done}{' ' * (50 - done)}]")
sys.stdout.flush()
tf.seek(0)
sys.stdout.write("\n")
with NamedTemporaryFile(suffix=suf, delete=not IS_WIN) as tf:
downloaded = 0
data_size = int(data_size)
completed = set()
os.makedirs(os.path.dirname(self._path), exist_ok=True)
for data in resp.iter_content(chunk_size=128):
downloaded += len(data)
tf.write(data)
done = int(100 * downloaded / data_size)
if done % 25 == 0 and done not in completed:
completed.add(done)
log(f"Downloading XMLTV file...{done}%" if done < 100 else "XMLTV file download complete.")
tf.seek(0)
if suf.endswith(".gz"):
try:
shutil.copyfile(tf.name, self._path)
except OSError as e:
log(f"{self.__class__.__name__} [download *.gz] error: {e}")
elif self._url.endswith((".xz", ".lzma")):
import lzma
os.makedirs(os.path.dirname(self._path), exist_ok=True)
try:
with lzma.open(tf, "rb") as lzf:
shutil.copyfileobj(lzf, self._path)
except (lzma.LZMAError, OSError) as e:
log(f"{self.__class__.__name__} [download *.xz] error: {e}")
else:
try:
import gzip
with gzip.open(self._path, "wb") as f_out:
shutil.copyfileobj(tf, f_out)
except OSError as e:
log(f"{self.__class__.__name__} [download *.xml] error: {e}")
if suf.endswith(".gz"):
try:
shutil.copyfile(tf.name, self._path)
except OSError as e:
log(f"{self.__class__.__name__} [download *.gz] error: {e}")
elif self._url.endswith((".xz", ".lzma")):
import lzma
if IS_WIN and os.path.isfile(tf.name):
tf.close()
os.remove(tf.name)
else:
log(f"{self.__class__.__name__} [download] error: {resp.reason}")
try:
with lzma.open(tf, "rb") as lzf:
shutil.copyfileobj(lzf, self._path)
except (lzma.LZMAError, OSError) as e:
log(f"{self.__class__.__name__} [download *.xz] error: {e}")
else:
try:
import gzip
with gzip.open(self._path, "wb") as f_out:
shutil.copyfileobj(tf, f_out)
except OSError as e:
log(f"{self.__class__.__name__} [download *.xml] error: {e}")
if IS_WIN and os.path.isfile(tf.name):
tf.close()
os.remove(tf.name)
else:
log(f"{self.__class__.__name__} [download] error: {resp.reason}")
except requests.exceptions.RequestException as e:
log(f"{self.__class__.__name__} [download] error: {e}")
return
if clb:
clb()
@@ -324,7 +326,7 @@ class XmlTvReader(Reader):
utc = dt.timestamp()
offset = datetime.now() - dt
for srv in filter(lambda s: any(name in names for name in s.names), self._cache.values()):
for srv in filter(lambda s: s.id in names or any(name in names for name in s.names), self._cache.values()):
[self.process_event(ev, events, offset, srv) for ev in filter(lambda s: s.duration > utc, srv.events)]
return events

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2023 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -31,14 +31,19 @@ import os
import re
import shutil
import subprocess
import tempfile
from collections import namedtuple
from datetime import datetime
from enum import IntEnum
from html.parser import HTMLParser
from io import BytesIO
from pathlib import Path
import requests
from app.commons import run_task, log
from app.commons import log, run_task
from app.settings import SettingsType, IS_LINUX, IS_WIN, IS_DARWIN, GTK_PATH
from .satellites import _HEADERS
from app.tools.satellites import _HEADERS
_ENIGMA2_PICON_KEY = "{:X}:{:X}:{}"
_NEUTRINO_PICON_KEY = "{:x}{:04x}{:04x}.png"
@@ -51,6 +56,12 @@ class PiconsError(Exception):
pass
class PiconFormat(IntEnum):
ENIGMA2 = 0
NEUTRINO = 1
OSCAM = 3
class PiconsCzDownloader:
""" The main class for loading picons from the https://picon.cz/ source (by Chocholoušek). """
@@ -67,46 +78,76 @@ class PiconsCzDownloader:
self._provider_logos = {}
self._picon_ids = picon_ids
self._appender = appender
self._logo_map = self.get_logos_map()
self._name_map = self.get_name_map()
self._perm_cache_file = Path(tempfile.gettempdir()).joinpath("picon_cz_links")
# subprocess creation flags
self._sbp_flags = subprocess.CREATE_NO_WINDOW if IS_WIN else 0
@property
def providers(self):
return self._providers
def init(self):
""" Initializes dict with values: download_id -> perm link and provider data. """
if self._perm_links:
return
self._HEADER["Referer"] = self._PERM_URL
if self._perm_cache_file.exists():
st = self._perm_cache_file.stat()
dif = datetime.now() - datetime.fromtimestamp(st.st_mtime)
# We will update daily.
if dif.days > 0:
self.download_permalinks()
else:
self.download_permalinks()
self.read_permalinks()
def download_permalinks(self):
self._HEADER["Referer"] = self._PERM_URL
with requests.get(url=self._PERM_URL, headers=self._HEADER, stream=True) as request:
if request.reason == "OK":
logo_map = self.get_logos_map()
name_map = self.get_name_map()
log(f"{self.__class__.__name__}: downloading permalinks file...")
buf = BytesIO()
[buf.write(chunk) for chunk in request.iter_content(chunk_size=128)]
buf.seek(0)
for line in request.iter_lines():
data = line.decode(encoding="utf-8", errors="ignore").split(maxsplit=1)
if len(data) != 2:
continue
l_id, perm_link = data
self._perm_links[str(l_id)] = str(perm_link)
data = re.match(self._LINK_PATTERN, perm_link)
if data:
sat_pos = data.group(3)
# Logo url.
logo = logo_map.get(data.group(2), None)
l_name = name_map.get(sat_pos, None) or sat_pos.replace(".", "")
logo_url = f"{self._BASE_LOGO_URL}{logo}/{l_name}.png" if logo else None
prv = Provider(None, data.group(1), sat_pos, self._BASE_URL + l_id, l_id, logo_url, None, False)
if sat_pos in self._providers:
self._providers[sat_pos].append(prv)
else:
self._providers[sat_pos] = [prv]
self._perm_cache_file.touch()
self._perm_cache_file.write_bytes(buf.read())
else:
log(f"{self.__class__.__name__} [get permalinks] error: {request.reason}")
raise PiconsError(request.reason)
@property
def providers(self):
return self._providers
def read_permalinks(self):
with self._perm_cache_file.open(encoding="utf-8", errors="ignore") as f:
for l in f.readlines():
data = l.split(maxsplit=1)
if len(data) != 2:
continue
data = l.split(maxsplit=1)
if len(data) != 2:
continue
l_id, perm_link = data
self._perm_links[str(l_id)] = str(perm_link)
self.update_provider_data(l_id, perm_link)
def update_provider_data(self, l_id, perm_link):
data = re.match(self._LINK_PATTERN, perm_link)
if data:
sat_pos = data.group(3)
# Logo url.
logo = self._logo_map.get(data.group(2), None)
l_name = self._name_map.get(sat_pos, None) or sat_pos.replace(".", "")
logo_url = f"{self._BASE_LOGO_URL}{logo}/{l_name}.png" if logo else None
prv = Provider(None, data.group(1), sat_pos, self._BASE_URL + l_id, l_id, logo_url, None, False)
if sat_pos in self._providers:
self._providers[sat_pos].append(prv)
else:
self._providers[sat_pos] = [prv]
def get_sat_providers(self, url):
return self._providers.get(url, [])
@@ -142,7 +183,10 @@ class PiconsCzDownloader:
cmd = [exe, "l", src]
try:
out, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
out, err = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
creationflags=self._sbp_flags).communicate()
if err:
log(f"{self.__class__.__name__} [extract] error: {err}")
raise PiconsError(err)
@@ -167,7 +211,10 @@ class PiconsCzDownloader:
cmd = [exe, "e", src, "-o{}".format(dest), "-y", "-r"]
cmd.extend(to_extract)
try:
out, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
out, err = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
creationflags=self._sbp_flags).communicate()
if err:
log(f"{self.__class__.__name__} [extract] error: {err}")
raise PiconsError(err)
@@ -200,7 +247,8 @@ class PiconsCzDownloader:
except requests.exceptions.ConnectionError as e:
log(f"{self.__class__.__name__} error [get provider logo]: {e}")
def get_logos_map(self):
@staticmethod
def get_logos_map():
return {"piconblack": "b50",
"picontransparent": "t50",
"piconwhite": "w50",
@@ -225,7 +273,8 @@ class PiconsCzDownloader:
"piconSNPblack": "b50",
}
def get_name_map(self):
@staticmethod
def get_name_map():
return {"antiksat": "ANTIK",
"digiczsk": "DIGI",
"DTTitaly": "picon_trs-it",
@@ -304,7 +353,7 @@ class PiconsParser(HTMLParser):
if req.status_code == 200:
logo_data = req.text
else:
log("Provider picons downloading error: {} {}".format(provider.url, req.reason))
log(f"Provider picons downloading error: {provider.url} {req.reason}")
return
on_id, pos, ssid, single = provider.on_id, provider.pos, provider.ssid, provider.single
@@ -335,7 +384,7 @@ class PiconsParser(HTMLParser):
p_name = picons_path + (name if name else os.path.basename(p.ref))
picons_data.append(("{}{}".format(PiconsParser._BASE_URL, p.ref), p_name))
except (TypeError, ValueError) as e:
msg = "Picons format parse error: {}".format(p) + "\n" + str(e)
msg = f"Picons format parse error: {p}\n{e}"
log(msg)
return picons_data
@@ -348,7 +397,7 @@ class PiconsParser(HTMLParser):
tr_id = int(ssid[:-2] if len(ssid) < 4 else ssid[:2])
return _NEUTRINO_PICON_KEY.format(tr_id, int(on_id), int(ssid))
else:
return "{}.png".format(ssid)
return f"{ssid}.png"
class ProviderParser(HTMLParser):
@@ -442,7 +491,7 @@ class ProviderParser(HTMLParser):
if req.status_code == 200:
logo_data = req.content
else:
log("Downloading provider logo error: {}".format(req.reason))
log(f"Downloading provider logo error: {req.reason}")
self.rows.append(Provider(logo=logo_data, name=name, pos=self._positon, url=row[6], on_id=on_id,
ssid=None, single=False, selected=True))
elif 6 < len_row < 12:
@@ -475,7 +524,7 @@ def parse_providers(url):
if request.status_code == 200:
parser.feed(request.text)
else:
log("Parse providers error [{}]: {}".format(url, request.reason))
log(f"Parse providers error [{url}]: {request.reason}")
def srt(p):
if p.logo is None:
@@ -504,26 +553,81 @@ def download_picon(src_url, dest_path):
for chunk in req:
f.write(chunk)
except OSError as e:
err_msg = "Saving picon [{}] error: {}".format(dest_path, e)
err_msg = f"Saving picon [{dest_path}] error: {e}"
log(err_msg)
@run_task
def convert_to(src_path, dest_path, s_type, done_callback):
""" Converts names format of picons.
def convert_to(src_path, dest_path, p_format, ids=None, services=None, done_callback=None):
""" Converts format [names] of picons.
Copies resulting files from src to dest and writes state to callback.
"""
pattern = "/*_0_0_0.png" if s_type is SettingsType.ENIGMA_2 else "/*.png"
pattern = "/*_0_0_0.png" if p_format is PiconFormat.NEUTRINO else "/*.png"
to_convert = []
for file in glob.glob(src_path + pattern):
base_name = os.path.basename(file)
if ids is not None and base_name not in ids:
continue
to_convert.append((base_name, file))
if p_format is PiconFormat.NEUTRINO:
convert_to_neutrino(to_convert, dest_path)
elif p_format is PiconFormat.OSCAM:
convert_to_oscam(to_convert, dest_path, services)
if done_callback:
done_callback()
def convert_to_neutrino(files, dest_path):
for base_name, file in files:
pic_data = base_name.rstrip(".png").split("_")
dest_file = _NEUTRINO_PICON_KEY.format(int(pic_data[4], 16), int(pic_data[5], 16), int(pic_data[3], 16))
dest = "{}/{}".format(dest_path, dest_file)
log('Converting "{}" to "{}"'.format(base_name, dest_file))
dest = f"{dest_path}{os.sep}{dest_file}"
log(f'Converting "{base_name}" to "{dest_file}"')
shutil.copyfile(file, dest)
done_callback()
def convert_to_oscam(files, dest_path, services):
if not files:
return
os.makedirs(dest_path, exist_ok=True)
import base64
from io import BytesIO
from PIL import Image
for base_name, file in files:
to_convert = []
srv = services.get(base_name, None)
if srv:
sid, flags = srv.ssid, srv.flags_cas
if flags:
cas = list(map(lambda c: c.lstrip("C:"), filter(lambda x: x.startswith("C:"), flags.split(","))))
if cas:
[to_convert.append(f"{dest_path}{os.sep}IC_{c.upper()}_{sid.upper()}.tpl") for c in cas]
else:
to_convert.append(f"{dest_path}{os.sep}{base_name}.tpl")
else:
to_convert.append(f"{dest_path}{os.sep}{base_name}.tpl")
else:
to_convert.append(f"{dest_path}{os.sep}{base_name}.tpl")
image = Image.open(file)
image.thumbnail((100, 60))
buff = BytesIO()
image.save(buff, format="PNG")
data_bytes = b"data:image/png;base64," + base64.b64encode(buff.getvalue())
for dest_file in to_convert:
log(f'Converting "{base_name}" to "{dest_file}"')
with open(dest_file, "wb") as f:
f.write(data_bytes)
if __name__ == "__main__":

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2023 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -338,7 +338,7 @@ class SatellitesParser(HTMLParser):
self.FEC.get(fec, None),
self.SYSTEM.get(sys, None),
self.MODULATION.get(mod, None),
pls_mode, pls_code, None, None)
pls_mode, pls_code, None, None, None)
if is_transponder_valid(tr):
trs.append(tr)
@@ -379,7 +379,7 @@ class SatellitesParser(HTMLParser):
self.FEC.get(fec, None),
self.SYSTEM.get(sys, None),
self.MODULATION.get(mod, None),
pls_mode, pls_code, is_id, None)
pls_mode, pls_code, is_id, None, None)
if is_transponder_valid(tr):
trs.append(tr)
@@ -392,7 +392,7 @@ class SatellitesParser(HTMLParser):
mod_pat = re.compile(r"(.*PSK).*?(?:.*Stream\s+(\d+))?.*")
sr_fec_pattern = re.compile(r"(\d{4,5})+\s+(\d+/\d+).*")
for row in filter(lambda r: len(r) == 16 and self.POS_PAT.match(r[0]), self._rows):
for row in filter(lambda r: len(r) == 14 and self.POS_PAT.match(r[0]), self._rows):
freq, pol = row[2].replace(".", "0"), row[3]
if not freq.isdigit() or pol not in "VHLR":
continue
@@ -421,7 +421,7 @@ class SatellitesParser(HTMLParser):
self.FEC.get(fec, None),
self.SYSTEM.get(sys, None),
self.MODULATION.get(mod, None),
pls_id, pls_code, is_id, None)
pls_id, pls_code, is_id, None, None)
if is_transponder_valid(tr):
trs.append(tr)
@@ -581,9 +581,9 @@ class ServicesParser(HTMLParser):
elif self._source is SatelliteSource.KINGOFSAT:
trs = []
for r in self._rows:
if len(r) == 13 and SatellitesParser.POS_PAT.match(r[0].text):
if len(r) == 12 and SatellitesParser.POS_PAT.match(r[0].text):
t_cell = r[4]
if t_cell.url and t_cell.url.startswith("tp.php?tp="):
if t_cell.url and t_cell.url.startswith("tp"):
t_cell.url = f"https://{self._lang}.kingofsat.tv/{t_cell.url}"
t_cell.text = f"{r[2].text} {r[3].text} {r[6].text} {r[8].text}"
trs.append(t_cell)
@@ -681,7 +681,7 @@ class ServicesParser(HTMLParser):
def get_kingofsat_services(self, sat_position=None, use_pids=False):
services = []
# Transponder
tr = list(filter(lambda r: len(r) == 13 and r[4].url and r[4].url.startswith("tp.php?tp="), self._rows))
tr = list(filter(lambda r: len(r) == 12 and r[4].url and r[4].url.startswith("tp"), self._rows))
if not tr:
log(f"ServicesParser error [get transponder services]: Transponder [{self._t_url}] not found!")
return services
@@ -689,9 +689,9 @@ class ServicesParser(HTMLParser):
tr, multi_tr, tid, nid, nsp = None, None, None, None, None
freq, sr, pol, fec, sys, pos = None, None, None, None, None, None
for r in filter(lambda x: len(x) > 12, self._rows):
for r in filter(lambda x: len(x) > 11, self._rows):
r_size = len(r)
if r_size == 13 and r[4].url and r[4].url.startswith("tp.php?tp="):
if r_size == 12 and r[4].url and r[4].url.startswith("tp"):
res = re.match(self._KING_TR_PAT, f"{r[6].text} {r[7].text}")
if not res:
continue

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2023 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -39,7 +39,7 @@ from urllib import parse
from urllib.error import URLError
from urllib.request import Request, urlopen, urlretrieve
from app.commons import log
from app.commons import log, run_task
from app.settings import SEP
from app.ui.uicommons import show_notification
@@ -172,22 +172,21 @@ class InnerTube:
_BASE_URI = "https://www.youtube.com/youtubei/v1"
_DEFAULT_CLIENTS = {
"WEB_EMBED": {"context": {"client": {"clientName": "WEB_EMBEDDED_PLAYER",
"clientVersion": "2.20210721.00.00",
"clientScreen": "EMBED"}},
"header": {"User-Agent": "Mozilla/5.0"},
"api_key": "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"},
"ANDROID_EMBED": {"context": {"client": {"clientName": "ANDROID_EMBEDDED_PLAYER",
"clientVersion": "17.31.35",
"clientScreen": "EMBED",
"androidSdkVersion": 30}},
"header": {"User-Agent": "com.google.android.youtube/"},
"api_key": "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"}
# The client is taken from -> https://github.com/JuanBindez/pytubefix
"ANDROID": {"context": {"client": {"clientName": "ANDROID",
"clientVersion": "19.44.38",
"platform": "MOBILE",
"osName": "Android",
"osVersion": "14",
"androidSdkVersion": "34"}},
"header": {"User-Agent": "com.google.android.youtube/",
"X-Youtube-Client-Name": "3"},
"api_key": "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",
"require_js_player": False,
"require_po_token": True}
}
def __init__(self, client="ANDROID_EMBED"):
def __init__(self, client="ANDROID"):
""" Initialize an InnerTube object.
@param client: Client to use for the object. Default to web because it returns the most playback types.
@@ -339,14 +338,14 @@ class YouTubeDL:
return cls._DL_INSTANCE
def init(self):
if not os.path.isfile(f"{self._path}yt_dlp{SEP}version.py"):
if os.path.isfile(f"{self._path}yt_dlp{SEP}version.py"):
if self._path not in sys.path:
sys.path.append(self._path)
self.init_dl()
else:
self.get_latest_release()
if self._path not in sys.path:
sys.path.append(self._path)
self.init_dl()
def init_dl(self):
try:
import yt_dlp
@@ -361,23 +360,16 @@ class YouTubeDL:
log(msg)
raise YouTubeException(msg)
if self._update:
if hasattr(yt_dlp.version, "__version__"):
l_ver = self.get_last_release_id()
cur_ver = yt_dlp.version.__version__
if l_ver and yt_dlp.version.__version__ < l_ver:
msg = f"yt-dlp has new release!\nCurrent: {cur_ver}. Last: {l_ver}."
show_notification(msg)
log(msg)
self._callback(msg, False)
self.get_latest_release()
self._DownloadError = yt_dlp.utils.DownloadError
self._dl = yt_dlp.YoutubeDL(self._OPTIONS)
msg = "yt-dlp initialized..."
show_notification(msg)
log(msg)
if self._update:
if hasattr(yt_dlp.version, "__version__"):
self.update(yt_dlp.version.__version__)
@staticmethod
def get_last_release_id():
""" Getting last release id. """
@@ -388,7 +380,18 @@ class YouTubeDL:
except URLError as e:
log(f"YouTubeDLHelper error [get last release id]: {e}")
def get_latest_release(self):
@run_task
def update(self, current_version):
l_ver = self.get_last_release_id()
if l_ver and current_version < l_ver:
msg = f"yt-dlp has new release!\nCurrent: {current_version}. Last: {l_ver}."
show_notification(msg)
log(msg)
self._callback(msg, False)
self.get_latest_release(update=True)
@run_task
def get_latest_release(self, update=False):
try:
self._is_update_process = True
log("Getting the last yt-dlp release...")
@@ -426,6 +429,8 @@ class YouTubeDL:
raise YouTubeException(e)
finally:
self._is_update_process = False
if not update:
self.init()
def get_yt_link(self, url, skip_errors=False):
""" Returns tuple from the video links [dict] and title. """

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -223,11 +223,11 @@ class BackupDialog:
self._settings.add("backup_tool_window_size", window.get_size())
def on_key_release(self, view, event):
""" Handling keystrokes """
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
""" Handling keystrokes. """
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
ctrl = event.state & MOD_MASK
if key is KeyboardKey.DELETE:

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -33,9 +33,11 @@ from datetime import datetime
from ftplib import all_errors
from pathlib import Path
from gi.repository.GObject import BindingFlags
from app.commons import log, run_task
from app.connections import UtfFTP
from app.settings import IS_DARWIN
from app.settings import IS_DARWIN, IS_WIN
from app.ui.dialogs import translate, get_chooser_dialog, show_dialog, DialogType
from app.ui.main_helper import get_picon_pixbuf, redraw_image
from app.ui.uicommons import HeaderBar
@@ -62,6 +64,8 @@ class BootLogoManager(Gtk.Window):
self._exe = f"{'./' if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS') else ''}ffmpeg"
self._pix = None
self._img_path = None
# subprocess creation flags
self._sbp_flags = subprocess.CREATE_NO_WINDOW if IS_WIN else 0
margin = {"margin_start": 5, "margin_end": 5, "margin_top": 5, "margin_bottom": 5}
base_margin = {"margin_start": 10, "margin_end": 10, "margin_top": 10, "margin_bottom": 10}
@@ -78,10 +82,10 @@ class BootLogoManager(Gtk.Window):
data_box.pack_end(self._image_area, True, True, 5)
self.add(main_box)
# Buttons
add_button = Gtk.Button.new_from_icon_name("insert-image-symbolic", Gtk.IconSize.BUTTON)
add_button.set_tooltip_text(translate("Add image"))
add_button.set_always_show_image(True)
add_button.connect("clicked", self.on_add_image)
add_path_button = Gtk.Button.new_from_icon_name("insert-image-symbolic", Gtk.IconSize.BUTTON)
add_path_button.set_tooltip_text(translate("Add image"))
add_path_button.set_always_show_image(True)
add_path_button.connect("clicked", self.on_add_image)
receive_button = Gtk.Button.new_from_icon_name("network-receive-symbolic", Gtk.IconSize.BUTTON)
receive_button.set_tooltip_text(translate("Download from the receiver"))
receive_button.set_always_show_image(True)
@@ -107,11 +111,13 @@ class BootLogoManager(Gtk.Window):
action_box = Gtk.ButtonBox()
action_box.set_layout(Gtk.ButtonBoxStyle.EXPAND)
action_box.add(add_button)
action_box.add(add_path_button)
action_box.add(self._convert_button)
action_box.add(self._format_button)
data_box.pack_start(action_box, False, False, 0)
# Settings.
self._stb_path_property = "boot_logo_manager_stb_paths"
popover = Gtk.Popover()
settings_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5, **base_margin)
file_name_box = Gtk.Box(spacing=5)
@@ -124,15 +130,48 @@ class BootLogoManager(Gtk.Window):
paths_box = Gtk.Box(spacing=5)
paths_box.add(Gtk.Label(translate("STB path:")))
self._path_combo_box = Gtk.ComboBoxText()
[self._path_combo_box.append(p, p) for p in _E2_STB_PATHS]
self._path_combo_box.set_active_id(_E2_STB_PATHS[0])
self._path_combo_box = Gtk.ComboBoxText(has_entry=True)
self._path_entry = self._path_combo_box.get_child()
self._path_entry.set_can_focus(False)
self._path_entry.connect("focus-out-event", self.on_path_entry_focus_out)
# Init paths.
self._stb_paths = self._app.app_settings.get(self._stb_path_property, _E2_STB_PATHS)
[self._path_combo_box.append(p, p) for p in self._stb_paths]
self._path_combo_box.set_active_id(self._stb_paths[0])
paths_box.pack_start(self._path_combo_box, True, True, 0)
settings_box.add(paths_box)
# Paths action box.
paths_action_box = Gtk.ButtonBox(homogeneous=True, layout_style=Gtk.ButtonBoxStyle.EXPAND)
self._remove_path_button = Gtk.Button.new_from_icon_name("list-remove-symbolic", Gtk.IconSize.BUTTON)
self._remove_path_button.set_tooltip_text(translate("Remove"))
self._remove_path_button.connect("clicked", self.on_remove_path)
add_e2_path_button = Gtk.Button.new_from_icon_name("list-add-symbolic", Gtk.IconSize.BUTTON)
add_e2_path_button.set_tooltip_text(translate("Add"))
add_e2_path_button.connect("clicked", self.on_add_path)
cancel_path_button = Gtk.Button.new_from_icon_name("edit-undo-symbolic", Gtk.IconSize.BUTTON)
cancel_path_button.set_tooltip_text(translate("Cancel"))
apply_path_button = Gtk.Button.new_from_icon_name("insert-link-symbolic", Gtk.IconSize.BUTTON)
apply_path_button.set_tooltip_text(translate("Apply"))
apply_path_button.set_can_focus(False)
apply_path_button.connect("clicked", self.on_apply_path)
paths_action_box.add(self._remove_path_button)
paths_action_box.add(add_e2_path_button)
paths_action_box.add(cancel_path_button)
paths_action_box.add(apply_path_button)
paths_box.pack_end(paths_action_box, True, True, 0)
settings_box.add(paths_box)
settings_box.pack_end(settings_close_button, False, False, 0)
settings_box.show_all()
cancel_path_button.set_visible(False)
apply_path_button.set_visible(False)
self._path_entry.bind_property("has-focus", apply_path_button, "visible")
apply_path_button.bind_property("visible", cancel_path_button, "visible")
apply_path_button.bind_property("visible", add_e2_path_button, "visible", BindingFlags.INVERT_BOOLEAN)
apply_path_button.bind_property("visible", self._remove_path_button, "visible", BindingFlags.INVERT_BOOLEAN)
popover.add(settings_box)
popover.connect("closed", self.on_settings_closed)
settings_button = Gtk.MenuButton(popover=popover, valign=Gtk.Align.CENTER, tooltip_text=translate("Options"))
settings_button.add(Gtk.Image.new_from_icon_name("applications-system-symbolic", Gtk.IconSize.BUTTON))
@@ -172,7 +211,9 @@ class BootLogoManager(Gtk.Window):
def init(self, *args):
log(f"{self.__class__.__name__} [init] Checking FFmpeg...")
try:
out = subprocess.check_output([self._exe, "-version"], stderr=subprocess.STDOUT)
out = subprocess.check_output([self._exe, "-version"],
stderr=subprocess.STDOUT,
creationflags=self._sbp_flags)
except FileNotFoundError as e:
msg = translate("Check if FFmpeg is installed!")
self._app.show_error_message(f"Error. {e} {msg}")
@@ -181,6 +222,43 @@ class BootLogoManager(Gtk.Window):
lines = out.decode(errors="ignore").splitlines()
log(lines[0] if lines else lines)
def on_add_path(self, button):
self._path_entry.set_can_focus(True)
self._path_entry.grab_focus()
def on_remove_path(self, button):
self._path_combo_box.remove(self._path_combo_box.get_active())
self._path_combo_box.set_active(0)
self._remove_path_button.set_sensitive(len(self._path_combo_box.get_model()) > 1)
def on_apply_path(self, button):
path = self._path_entry.get_text()
paths = {r[0] for r in self._path_combo_box.get_model()}
if path in paths:
self._app.show_error_message("This path already exists!")
return True
self._path_combo_box.append(path, path)
self._path_combo_box.set_active_id(path)
self._remove_path_button.grab_focus()
self._remove_path_button.set_sensitive(len(paths))
return False
def on_path_entry_focus_out(self, entry, event):
entry.set_can_focus(False)
active = self._path_combo_box.get_active_id()
txt = entry.get_text()
if active != txt:
entry.set_text(active or "")
def on_settings_closed(self, popover):
paths = tuple(r[0] for r in self._path_combo_box.get_model())
if paths != self._stb_paths:
self._stb_paths = paths
self._app.app_settings.add(self._stb_path_property, self._stb_paths)
def on_add_image(self, button):
file_filter = None
if IS_DARWIN:
@@ -223,7 +301,12 @@ class BootLogoManager(Gtk.Window):
return
output = path.parent.joinpath(self._file_combo_box.get_active_id())
ffmpeg_output = path.parent.joinpath(f"{self._file_combo_box.get_active_text()}.m1v")
if Path(output).exists():
msg = f"\n{translate('The file already exists!')}\n\n\t{translate('Are you sure?')}"
if show_dialog(DialogType.QUESTION, self, msg) != Gtk.ResponseType.OK:
return True
ffmpeg_output = path.parent.joinpath(f"{self._file_combo_box.get_active_text()}.m2v")
cmd = [self._exe,
"-i", self._img_path,
@@ -248,9 +331,9 @@ class BootLogoManager(Gtk.Window):
# Processing image.
log(f"{self.__class__.__name__} [convert] Converting...")
subprocess.run(cmd)
subprocess.run(cmd, creationflags=self._sbp_flags)
if Path(ffmpeg_output).exists():
os.rename(ffmpeg_output, output)
os.replace(ffmpeg_output, output)
log(f"{self.__class__.__name__} [convert] -> '{output}'. Done!")
if cmd[2] != self._img_path:
@@ -262,13 +345,13 @@ class BootLogoManager(Gtk.Window):
def convert_to_image(self, video_path, img_path):
cmd = [self._exe, "-y", "-i", video_path, img_path]
subprocess.run(cmd)
subprocess.run(cmd, creationflags=self._sbp_flags)
@run_task
def download_data(self, f_name):
try:
settings = self._app.app_settings
with UtfFTP(host=settings.host, user=settings.user, passwd=settings.password) as ftp:
with UtfFTP(host=settings.host, port=settings.port, user=settings.user, passwd=settings.password) as ftp:
ftp.encoding = "utf-8"
ftp.cwd(self._path_combo_box.get_active_id())
@@ -280,7 +363,7 @@ class BootLogoManager(Gtk.Window):
img_path = f"{path}{f_name}.jpg"
if vp.exists():
rn_path = f"{path}{self._file_combo_box.get_active_text()}.m1v"
rn_path = f"{path}{self._file_combo_box.get_active_text()}.m2v"
vp.rename(rn_path)
self.convert_to_image(rn_path, img_path)
self._pix = get_picon_pixbuf(img_path, -1)
@@ -294,7 +377,7 @@ class BootLogoManager(Gtk.Window):
def transfer_data(self, f_path):
try:
settings = self._app.app_settings
with UtfFTP(host=settings.host, user=settings.user, passwd=settings.password) as ftp:
with UtfFTP(host=settings.host, port=settings.port, user=settings.user, passwd=settings.password) as ftp:
ftp.encoding = "utf-8"
ftp.cwd(self._path_combo_box.get_active_id())

View File

@@ -3,7 +3,7 @@
The MIT License (MIT)
Copyright (c) 2018-2024 Dmitriy Yefremov
Copyright (c) 2018-2026 Dmitriy Yefremov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,7 @@ Author: Dmitriy Yefremov
<!-- interface-license-type mit -->
<!-- interface-name DemonEditor -->
<!-- interface-description Enigma2 channel and satellites list editor. -->
<!-- interface-copyright 2018-2024 Dmitriy Yefremov -->
<!-- interface-copyright 2018-2026 Dmitriy Yefremov -->
<!-- interface-authors Dmitriy Yefremov -->
<object class="GtkAboutDialog" id="about_dialog">
<property name="can_focus">False</property>
@@ -40,8 +40,8 @@ Author: Dmitriy Yefremov
<property name="icon_name">system-help</property>
<property name="type_hint">normal</property>
<property name="program_name">DemonEditor</property>
<property name="version">3.11.3 Beta</property>
<property name="copyright">2018-2024 Dmitriy Yefremov
<property name="version">3.14.4 Beta</property>
<property name="copyright">2018-2026 Dmitriy Yefremov
</property>
<property name="comments" translatable="yes">Enigma2 channel and satellite list editor.</property>
<property name="website">https://dyefremov.github.io/DemonEditor/</property>
@@ -158,6 +158,7 @@ Author: Dmitriy Yefremov
<property name="can_focus">False</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="width-request">170</property>
<property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">splashscreen</property>
@@ -166,19 +167,19 @@ Author: Dmitriy Yefremov
<property name="decorated">False</property>
<child>
<object class="GtkBox" id="wait_dialog_box">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="margin-start">10</property>
<property name="margin_end">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkSpinner" id="spinner">
<property name="width_request">150</property>
<property name="height_request">45</property>
<property name="visible">True</property>
<object class="LoadingProgressBar" id="progress">
<property name="visible" bind-source="wait_dialog" bind-property="visible">True</property>
<property name="can_focus">False</property>
<property name="active">True</property>
<property name="show-text">True</property>
<property name="text" translatable="yes">Loading data...</property>
</object>
<packing>
<property name="expand">False</property>
@@ -186,24 +187,10 @@ Author: Dmitriy Yefremov
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="wait_dialog_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="label" translatable="yes">Loading data...</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child> <!-- NOP -->
<style>
<class name="app-notification"/>
<class name="primary-toolbar"/>
</style>
</object>
</interface>

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -34,7 +34,7 @@ from functools import lru_cache
from pathlib import Path
from app.commons import run_idle
from app.settings import SEP, IS_WIN, USE_HEADER_BAR
from app.settings import SEP, USE_HEADER_BAR, IS_LINUX
from .uicommons import Gtk, UI_RESOURCES_PATH, TEXT_DOMAIN
@@ -101,8 +101,8 @@ class WaitDialog:
builder, dialog = get_dialog_from_xml(DialogType.WAIT, transient)
self._dialog = dialog
self._dialog.set_transient_for(transient)
self._label = builder.get_object("wait_dialog_label")
self._default_text = text or self._label.get_text()
self._progress = builder.get_object("progress")
self._default_text = text or self._progress.get_text()
def show(self, text=None):
self.set_text(text)
@@ -110,7 +110,7 @@ class WaitDialog:
@run_idle
def set_text(self, text):
self._label.set_text(translate(text or self._default_text))
self._progress.set_text(translate(text or self._default_text))
@run_idle
def hide(self):
@@ -228,7 +228,7 @@ def translate(message):
@lru_cache(maxsize=5)
def get_dialogs_string(path, tag="property"):
if IS_WIN:
if not IS_LINUX:
return translate_xml(path, tag)
else:
with open(path, "r", encoding="utf-8") as f:
@@ -257,7 +257,7 @@ def get_builder(path, handlers=None, use_str=False, objects=None, tag="property"
def translate_xml(path, tag="property"):
""" Used to translate GUI from * .glade files in MS Windows.
""" Used to translate GUI from *.glade files to macOS and MS Windows.
More info: https://gitlab.gnome.org/GNOME/gtk/-/issues/569
"""

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2
<!-- Generated with glade 3.40.0
The MIT License (MIT)
@@ -87,9 +87,9 @@ Author: Dmitriy Yefremov
<property name="can-focus">False</property>
<child>
<object class="GtkMenuItem" id="bouquet_assign_ref_popup_item">
<property name="label" translatable="yes">Assign</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Assign</property>
<signal name="activate" handler="on_assign_ref" swapped="no"/>
<accelerator key="v" signal="activate" modifiers="Primary"/>
</object>
@@ -217,12 +217,11 @@ Author: Dmitriy Yefremov
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">10</property>
<property name="margin-right">10</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
@@ -241,7 +240,7 @@ Author: Dmitriy Yefremov
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox" id="source_selection_box">
<property name="visible">True</property>
@@ -293,7 +292,7 @@ Author: Dmitriy Yefremov
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<property name="spacing">5</property>
<child>
<object class="GtkFileChooserButton" id="xml_chooser_button">
<property name="visible">True</property>
@@ -399,6 +398,7 @@ Author: Dmitriy Yefremov
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Filter by presence in the epg.dat file.</property>
<property name="margin-top">5</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
@@ -432,13 +432,52 @@ Author: Dmitriy Yefremov
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Enables deeper name matching. Possible inaccuracies!</property>
<property name="margin-top">5</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Enable deep name comparison</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="enable_deep_comparing_switch">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">end</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="epg_dat_source_box">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
@@ -551,7 +590,7 @@ Author: Dmitriy Yefremov
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">4</property>
</packing>
</child>
</object>
@@ -565,6 +604,7 @@ Author: Dmitriy Yefremov
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
</object>
<packing>
<property name="expand">False</property>
@@ -576,6 +616,8 @@ Author: Dmitriy Yefremov
<object class="GtkBox" id="actions_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="spacing">5</property>
<property name="homogeneous">True</property>
<child>

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -29,6 +29,7 @@
""" Module for working with EPG. """
import abc
import gzip
import json
import locale
import os
import re
@@ -43,7 +44,7 @@ from urllib.parse import quote
from gi.repository import GLib
from app.commons import run_idle, run_task, run_with_delay
from app.commons import run_idle, run_task, run_with_delay, log
from app.connections import download_data, DownloadType, HttpAPI
from app.eparser.ecommons import BouquetService, BqServiceType
from app.settings import SEP, EpgSource, IS_WIN
@@ -61,7 +62,80 @@ class RefsSource(Enum):
XML = 1
class StringComparer:
""" Additional string similarity comparer. """
class ALG(Enum):
JARO = "Jaro-Winkler"
@staticmethod
def jaro_distance(s1, s2):
""" Returns [Jaro-Winkler] distance of two strings."""
if s1 == s2:
return 1.0
len1, len2 = len(s1), len(s2)
if len1 == 0 or len2 == 0:
return 0.0
match = 0
max_dist = (max(len(s1), len(s2)) // 2) - 1
s1_hash = [0] * len(s1)
s2_hash = [0] * len(s2)
for i in range(len1):
for j in range(max(0, i - max_dist), min(len2, i + max_dist + 1)):
if s1[i] == s2[j] and s2_hash[j] == 0:
s1_hash[i] = 1
s2_hash[j] = 1
match += 1
break
if match == 0:
return 0.0
t = 0
point = 0
for i in range(len1):
if s1_hash[i]:
while s2_hash[point] == 0:
point += 1
if s1[i] != s2[point]:
point += 1
t += 1
else:
point += 1
t /= 2
return (match / len1 + match / len2 + (match - t) / match) / 3.0
@staticmethod
def is_similar(s1, s2, alg, max_ch=4, ratio=0.92):
""" Returns similarity of two strings. """
if alg is StringComparer.ALG.JARO:
dist = StringComparer.jaro_distance(s1, s2)
if dist > 0.7:
prefix = 0
for i in range(min(len(s1), len(s2))):
if s1[i] == s2[i]:
prefix += 1
else:
break
prefix = min(max_ch, prefix) # Maximum of [max_ch] characters are allowed in prefix!
dist += 0.1 * prefix * (1 - dist)
return dist > ratio
else:
raise ValueError(f"This algorithm [{alg}] is not supported!")
class EpgCache(abc.ABC):
_CACHE_FILE = "epg-name-cache"
NAME_CACHE = {} # service name -> id (tvg-id for *.m3u)
def __init__(self, app):
super().__init__()
self.events = {}
@@ -83,6 +157,9 @@ class EpgCache(abc.ABC):
self._app.connect("epg-settings-changed", self.on_settings_changed)
self._app.connect("task-canceled", self.on_xml_load_cancel)
if self._app.app_settings.enable_epg_name_cache:
self.init_name_cache(self._app.app_settings.default_data_path)
@property
def current_reader(self):
return self._reader
@@ -133,6 +210,30 @@ class EpgCache(abc.ABC):
f_sha1 = sha1(url.encode("utf-8", errors="ignore")).hexdigest()
return f"{path}epg{os.sep}{f_sha1}_epg.gz"
@staticmethod
@run_task
def update_name_cache(path, values):
EpgCache.NAME_CACHE.update(values)
log(f"[{EpgCache.__name__}] Updating name cache...")
f_name = f"{path}{EpgCache._CACHE_FILE}"
with open(f_name, "w", encoding="utf-8") as cf:
log(f"[{EpgCache.__name__}] Dumping name cache... -> [{f_name}]")
json.dump(EpgCache.NAME_CACHE, cf)
@staticmethod
@run_task
def init_name_cache(path):
f_name = f"{path}{EpgCache._CACHE_FILE}"
if not os.path.isfile(f_name):
return
log(f"[{EpgCache.__name__}] Name cache init...")
try:
with open(f_name, "r", encoding="utf-8") as cf:
EpgCache.NAME_CACHE.update(json.load(cf))
except Exception as e:
log(f"[{EpgCache.__name__}] Name cache init error: {e}")
class FavEpgCache(EpgCache):
@@ -216,13 +317,18 @@ class FavEpgCache(EpgCache):
def update_xml_data(self):
services = self._app.current_services
names = {services[s].service for s in self._app.current_bouquets.get(self._current_bq, []) if s in services}
if self._app.app_settings.enable_epg_name_cache:
id_names = set(filter(lambda n: n in EpgCache.NAME_CACHE, names))
names -= id_names
names.update({EpgCache.NAME_CACHE.get(n) for n in id_names})
for name, events in self._reader.get_current_events(names).items():
ev = min(events, key=lambda x: x.start, default=None)
if ev:
self.events[name] = ev
def get_current_event(self, service_name):
return self.events.get(service_name, EpgEvent())
return self.events.get(EpgCache.NAME_CACHE.get(service_name, service_name), EpgEvent())
def get_current_events(self, service_name):
return [EpgEvent()]
@@ -316,6 +422,12 @@ class TabEpgCache(EpgCache):
def update_epg_data(self) -> bool:
services = self._app.current_services
names = {services[s].service for s in chain.from_iterable(self._app.current_bouquets.values()) if s in services}
if self._app.app_settings.enable_epg_name_cache:
id_names = set(filter(lambda n: n in EpgCache.NAME_CACHE, names))
names -= id_names
names.update({EpgCache.NAME_CACHE.get(n) for n in id_names})
for name, events in self._reader.get_current_events(names).items():
self.events[name] = events
@@ -327,7 +439,7 @@ class TabEpgCache(EpgCache):
pass
def get_current_events(self, service_name) -> list:
return self.events.get(service_name, [])
return self.events.get(EpgCache.NAME_CACHE.get(service_name, service_name), [])
class EpgSettingsPopover(Gtk.Popover):
@@ -456,6 +568,7 @@ class TabEpgSettingsPopover(EpgSettingsPopover):
self._url_combo_box.get_model().clear()
[self._url_combo_box.append(i, i) for i in settings.epg_xml_sources if i]
self._url_combo_box.set_active_id(settings.epg_xml_source)
self._remove_url_button.set_sensitive(len(self._url_combo_box.get_model()) > 1)
def on_apply(self, button):
settings = self._app.app_settings
@@ -592,7 +705,11 @@ class EpgTool(Gtk.Box):
return
if self._multi_epg_button.get_active():
path = next((r.path for r in self._model if r[-1].get("e2eventservicename", None) == srv.service), None)
name = srv.service
if self._app.app_settings.enable_epg_name_cache:
name = EpgCache.NAME_CACHE.get(name, name)
path = next((r.path for r in self._model if r[-1].get("e2eventservicename", None) == name), None)
scroll_to(path, self._view) if path else None
else:
self._app.wait_dialog.show()
@@ -864,6 +981,8 @@ class EpgDialog:
self._left_action_box = builder.get_object("left_action_box")
self._xml_download_progress_bar = builder.get_object("xml_download_progress_bar")
self._src_load_spinner = builder.get_object("src_load_spinner")
self._auto_config_button = builder.get_object("auto_config_button")
self._enable_deep_comparing_switch = builder.get_object("enable_deep_comparing_switch")
# Filter
self._filter_bar = builder.get_object("filter_bar")
self._filter_entry = builder.get_object("filter_entry")
@@ -1099,10 +1218,10 @@ class EpgDialog:
def on_key_press(self, view, event):
""" Handling keystrokes """
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
ctrl = event.state & Gdk.ModifierType.CONTROL_MASK
if ctrl and key is KeyboardKey.C:
@@ -1153,12 +1272,17 @@ class EpgDialog:
num=r[Column.FAV_NUM])
services.append(srv)
ChannelsParser.write_refs_to_xml("{}{}.xml".format(response, self._bouquet_name), services)
ChannelsParser.write_refs_to_xml(f"{response}{self._bouquet_name}.xml", services)
self.show_info_message(translate("Done!"), Gtk.MessageType.INFO)
@run_idle
def on_auto_configuration(self, item):
gen = self.auto_configuration()
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
def auto_configuration(self):
""" Simple mapping of services by name. """
self._auto_config_button.set_sensitive(False)
use_cyrillic = locale.getdefaultlocale()[0] in ("ru_RU", "be_BY", "uk_UA", "sr_RS")
tr = None
if use_cyrillic:
@@ -1186,20 +1310,28 @@ class EpgDialog:
if ref:
self.assign_data(r, ref, True)
success_count += 1
self._bouquet_epg_count_label.set_text(str(success_count))
yield True
else:
not_founded[name] = r
# Additional attempt to search in the remaining elements
use_deep = self._enable_deep_comparing_switch.get_active()
for n in not_founded:
for k in source:
if k.startswith(n):
if StringComparer.is_similar(k, n, StringComparer.ALG.JARO) if use_deep else k.startswith(n):
self.assign_data(not_founded[n], source[k], True)
success_count += 1
self._bouquet_epg_count_label.set_text(str(success_count))
break
yield True
self._auto_config_button.set_sensitive(True)
self.update_epg_count()
self.show_info_message("{} {} {}".format(translate("Done!"),
translate("Count of successfully configured services:"),
success_count), Gtk.MessageType.INFO)
yield True
def assign_refs(self, model, paths, data):
[self.assign_data(model[p], data) for p in paths]
@@ -1369,6 +1501,7 @@ class EpgDialog:
self._url_to_xml_entry.set_text(epg_options.get("url_to_xml", ""))
self._enable_dat_filter = epg_options.get("enable_filtering", False)
self._enable_filtering_switch.set_active(self._enable_dat_filter)
self._enable_deep_comparing_switch.set_active(epg_options.get("enable_deep_comparing", False))
epg_dat_path = epg_options.get("epg_dat_path", epg_dat_path)
self._epg_dat_path_entry.set_text(epg_dat_path)
self._epg_dat_stb_path_entry.set_text(epg_options.get("epg_dat_stb_path", default_epg_data_stb_path))
@@ -1385,6 +1518,7 @@ class EpgDialog:
"local_path_to_xml": self._xml_chooser_button.get_filename(),
"url_to_xml": self._url_to_xml_entry.get_text(),
"enable_filtering": self._enable_filtering_switch.get_active(),
"enable_deep_comparing": self._enable_deep_comparing_switch.get_active(),
"epg_dat_path": self._epg_dat_path_entry.get_text(),
"epg_dat_stb_path": self._epg_dat_stb_path_entry.get_text(),
"epg_data_update_on_start": self._update_on_start_switch.get_active()}

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2023-2024 Dmitriy Yefremov
# Copyright (c) 2023-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -35,7 +35,7 @@ import requests
from gi.repository import Gtk, Gdk, GLib, Pango, GObject
from app.commons import log, run_task, run_idle
from app.ui.dialogs import translate
from app.ui.dialogs import translate, show_dialog, DialogType
from app.ui.uicommons import HeaderBar
EXT_URL = "https://api.github.com/repos/DYefremov/demoneditor-extensions/contents/extensions/"
@@ -48,7 +48,7 @@ HEADERS = {"User-Agent": "Mozilla/5.0 (X11; Linux i686; rv:112.0) Gecko/20100101
class ExtensionManager(Gtk.Window):
ICON_INFO = "emblem-important-symbolic"
ICON_INFO = "emblem-synchronizing-symbolic"
ICON_UPDATE = "network-receive-symbolic"
class Column(IntEnum):
@@ -193,6 +193,22 @@ class ExtensionManager(Gtk.Window):
self.connect("delete-event", lambda w, e: self._app.app_settings.add(ws_property, w.get_size()))
self.connect("realize", self.init)
self.connect("show", self.on_show)
def on_show(self, window):
enabled = self._app.app_settings.extensions_support
self.set_sensitive(enabled)
if not enabled:
msg = f"\n{translate('Extension support is disabled!')}\n\n\t{translate('Do you want to enable it?')}"
if show_dialog(DialogType.QUESTION, self, msg) != Gtk.ResponseType.OK:
self.close()
return True
self._app.app_settings.extensions_support = True
self._app.show_info_message(translate('Restart the program to apply all changes.'), Gtk.MessageType.WARNING)
self.close()
return False
def init(self, widget):
self._load_spinner.start()
@@ -281,6 +297,7 @@ class ExtensionManager(Gtk.Window):
ext_ver = ext[0].VERSION
path = ext[1]
if ext_ver < ver:
desc = f"[ Update -> ver. {ver} ] {desc}"
ver = ext_ver
info = self.ICON_INFO

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -318,7 +318,8 @@ class FtpClientBox(Gtk.HBox):
if self._ftp:
self._ftp.close()
self._ftp = UtfFTP(host=self._settings.host, user=self._settings.user, passwd=self._settings.password)
host, port = self._settings.host, self._settings.port
self._ftp = UtfFTP(host=host, port=port, user=self._settings.user, passwd=self._settings.password)
self._ftp.encoding = "utf-8"
self.update_ftp_info(self._ftp.getwelcome())
except all_errors as e:
@@ -855,11 +856,10 @@ class FtpClientBox(Gtk.HBox):
self._settings.ftp_bookmarks = [r[0] for r in self._bookmark_model]
def on_view_key_press(self, view, event):
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
ctrl = event.state & MOD_MASK
if key is KeyboardKey.F7:

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -97,7 +97,7 @@ def import_bouquet(app, model, path, appender, file_path=None):
def get_enigma2_bouquet(path):
p = Path(path)
bq = BouquetsReader.get_bouquet(f"{p.parent}{SEP}", f"{p.stem}{p.suffix}", p.stem)
bq = BouquetsReader().get_bouquet(f"{p.parent}{SEP}", f"{p.stem}{p.suffix}", p.stem)
bouquet = Bouquet(name=bq[0], type=BqType(p.suffix.lstrip(".")).value, services=bq[1], locked=None, hidden=None)
return bouquet
@@ -194,7 +194,11 @@ class ImportDialog:
try:
if not self._bouquets:
log("Import [init data]: getting bouquets...")
self._bouquets = get_bouquets(path, self._profile)
self._bouquets, errors = get_bouquets(path, self._profile)
if errors:
msg = translate('There were errors [%s] during bouquets loading!') % errors
self.show_info_message(f"{msg} {translate('Check the log for more info.')}",
Gtk.MessageType.WARNING)
for bqs in self._bouquets:
for bq in bqs.bouquets:
self._bq_model.append((bq.name, bq.type, True))
@@ -422,10 +426,9 @@ class ImportDialog:
def on_key_press(self, view, event):
""" Handling keystrokes """
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
if key is KeyboardKey.SPACE:
model = view.get_model()

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -46,6 +46,7 @@ from app.eparser.iptv import (NEUTRINO_FAV_ID_FORMAT, StreamType, ENIGMA2_FAV_ID
from app.settings import SettingsType
from app.tools.yt import YouTubeException, YouTube
from app.ui.dialogs import Action, show_dialog, DialogType, translate, get_builder, BaseDialog
from app.ui.epg.epg import EpgCache
from app.ui.main_helper import get_iptv_url, on_popup_menu, get_picon_pixbuf, show_info_bar_message, gen_bouquet_name
from app.ui.uicommons import (Gtk, Gdk, UI_RESOURCES_PATH, IPTV_ICON, Column, KeyboardKey, get_yt_icon, HeaderBar)
@@ -769,6 +770,8 @@ class M3uImportDialog(IptvListDialog):
picons = {}
services = self._services
if self._app.app_settings.enable_epg_name_cache:
EpgCache.update_name_cache(self._app.app_settings.default_data_path, {s[3]: s[0] for s in services if s[0]})
if not self.is_all_data_default():
services = []
@@ -1328,10 +1331,9 @@ class YtListImportDialog:
view.get_model().foreach(lambda mod, path, itr: mod.set_value(itr, 2, select))
def on_key_press(self, view, event):
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
if key is KeyboardKey.SPACE:
path, column = view.get_cursor()

Binary file not shown.

View File

@@ -3,7 +3,7 @@
The MIT License (MIT)
Copyright (c) 2018-2024 Dmitriy Yefremov
Copyright (c) 2018-2025 Dmitriy Yefremov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@ Author: Dmitriy Yefremov
<!-- interface-license-type mit -->
<!-- interface-name DemonEditor -->
<!-- interface-description Enigma2 channel and satellite list editor. -->
<!-- interface-copyright 2018-2024 Dmitriy Yefremov -->
<!-- interface-copyright 2018-2025 Dmitriy Yefremov -->
<!-- interface-authors Dmitriy Yefremov -->
<object class="GtkListStore" id="alt_list_store">
<columns>
@@ -57,12 +57,23 @@ Author: Dmitriy Yefremov
<object class="GtkMenu" id="alt_popup_menu">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkMenuItem" id="alt_paste_popup_item">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Paste</property>
<signal name="activate" handler="on_alt_paste" swapped="no"/>
<accelerator key="v" signal="activate" modifiers="Primary"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="alt_remove_popup_item">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remove</property>
<signal name="activate" handler="on_delete" object="alt_tree_view" swapped="no"/>
<accelerator key="Delete" signal="activate"/>
</object>
</child>
</object>
@@ -298,6 +309,67 @@ Author: Dmitriy Yefremov
</object>
</child>
</object>
<object class="GtkPopover" id="filter_cas_popover">
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="border-width">5</property>
<property name="orientation">vertical</property>
<property name="layout-style">expand</property>
<child>
<object class="GtkRadioButton" id="filter_all_button">
<property name="label" translatable="yes">All</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="active">True</property>
<property name="draw-indicator">False</property>
<signal name="toggled" handler="on_filter_changed" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="filter_free_button">
<property name="label" translatable="yes">Free (FTA)</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">False</property>
<property name="group">filter_coded_button</property>
<signal name="toggled" handler="on_filter_changed" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="filter_coded_button">
<property name="label" translatable="yes">Coded</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">False</property>
<property name="group">filter_all_button</property>
<signal name="toggled" handler="on_filter_changed" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkListStore" id="filter_sat_pos_list_store">
<columns>
<!-- column-name satellite -->
@@ -1479,9 +1551,42 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkMenuItem" id="services_add_new_popup_item">
<property name="can-focus">False</property>
<property name="label" translatable="yes">New</property>
<signal name="activate" handler="on_services_add_new" swapped="no"/>
<property name="visible">True</property>
<property name="can-focus">False</property>
<child type="submenu">
<object class="GtkMenu" id="et_popup_menu">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Satellite channel</property>
<property name="name">s</property>
<signal name="activate" handler="on_services_add_new" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Terrestrial channel</property>
<property name="name">t</property>
<signal name="activate" handler="on_services_add_new" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cable channel</property>
<property name="name">c</property>
<signal name="activate" handler="on_services_add_new" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
@@ -1596,6 +1701,7 @@ Author: Dmitriy Yefremov
</object>
<object class="GtkComboBoxText" id="profile_combo_box">
<property name="visible">True</property>
<property name="sensitive" bind-source="iptv_progress_bar" bind-property="visible" bind-flags="invert-boolean">True</property>
<property name="can-focus">False</property>
<property name="focus-on-click">False</property>
<property name="active">0</property>
@@ -1746,7 +1852,7 @@ Author: Dmitriy Yefremov
<object class="GtkLabel" id="app_ver_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label">3.11.3 Beta</property>
<property name="label">3.14.4 Beta</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -1800,6 +1906,7 @@ Author: Dmitriy Yefremov
<property name="label" translatable="yes">DVB</property>
<property name="width-request">80</property>
<property name="visible">True</property>
<property name="sensitive" bind-source="iptv_progress_bar" bind-property="visible" bind-flags="invert-boolean">True</property>
<property name="can-focus">False</property>
<property name="receives-default">False</property>
<property name="active">True</property>
@@ -1816,6 +1923,7 @@ Author: Dmitriy Yefremov
<object class="GtkRadioButton" id="iptv_button">
<property name="label" translatable="yes">IPTV</property>
<property name="visible">True</property>
<property name="sensitive" bind-source="services_progress_bar" bind-property="visible" bind-flags="invert-boolean">True</property>
<property name="can-focus">False</property>
<property name="receives-default">False</property>
<property name="active">True</property>
@@ -1839,7 +1947,7 @@ Author: Dmitriy Yefremov
<child>
<object class="GtkToggleButton" id="filter_services_button">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="sensitive" bind-source="services_progress_bar" bind-property="visible" bind-flags="invert-boolean">False</property>
<property name="can-focus">False</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
@@ -1861,6 +1969,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkToggleButton" id="filter_iptv_services_button">
<property name="sensitive" bind-source="iptv_progress_bar" bind-property="visible" bind-flags="invert-boolean">False</property>
<property name="can-focus">False</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
@@ -2022,22 +2131,23 @@ Author: Dmitriy Yefremov
<object class="GtkBox" id="services_fs_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-bottom">5</property>
<property name="spacing">10</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox" id="filter_box">
<property name="can-focus">False</property>
<property name="valign">center</property>
<child>
<object class="GtkToggleButton" id="filter_only_free_button">
<object class="GtkMenuButton" id="filter_cas_menu_button">
<property name="width-request">50</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Only free</property>
<signal name="toggled" handler="on_filter_changed" swapped="no"/>
<property name="tooltip-text" translatable="yes">Access</property>
<property name="popover">filter_cas_popover</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -2619,8 +2729,8 @@ Author: Dmitriy Yefremov
<property name="height-request">26</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="resize-mode">queue</property>
<property name="spacing">2</property>
<child>
@@ -2753,12 +2863,13 @@ Author: Dmitriy Yefremov
</packing>
</child>
<child>
<object class="GtkSpinner" id="services_load_spinner">
<property name="visible">True</property>
<object class="GtkProgressBar" id="services_progress_bar">
<property name="visible">False</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Loading data...</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="margin-start">15</property>
</object>
<packing>
<property name="expand">False</property>
@@ -2767,6 +2878,37 @@ Author: Dmitriy Yefremov
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkImage" id="current_data_path_image">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Current data path</property>
<property name="icon-name">document-open-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="current_data_path_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Current data path</property>
<property name="label"> </property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
<attributes>
<attribute name="size" value="8000"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">12</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
@@ -3101,8 +3243,8 @@ Author: Dmitriy Yefremov
</packing>
</child>
<child>
<object class="GtkSpinner" id="iptv_services_load_spinner">
<property name="visible">True</property>
<object class="GtkProgressBar" id="iptv_progress_bar">
<property name="visible">False</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Loading data...</property>
<property name="halign">center</property>
@@ -3730,6 +3872,8 @@ Author: Dmitriy Yefremov
<signal name="drag-begin" handler="on_view_drag_begin" after="yes" swapped="no"/>
<signal name="drag-data-get" handler="on_view_drag_data_get" swapped="no"/>
<signal name="drag-data-received" handler="on_alt_view_drag_data_received" swapped="no"/>
<signal name="focus-in-event" handler="on_view_focus" swapped="no"/>
<signal name="key-press-event" handler="on_alt_view_key_press" swapped="no"/>
<signal name="row-activated" handler="on_alt_selection" object="alt_list_store" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
@@ -4662,97 +4806,185 @@ Author: Dmitriy Yefremov
<property name="can-focus">False</property>
<property name="stack">stack</property>
</object>
<object class="GtkButtonBox" id="toolbar_main_box">
<object class="GtkPopover" id="send_popover">
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="border-width">5</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<property name="layout-style">expand</property>
<child>
<object class="GtkModelButton" id="send_srv_button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="action-name">app.on_send</property>
<property name="text" translatable="yes">All</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="send_bq_button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="action-name">app.upload_bouquets</property>
<property name="text" translatable="yes">Bouquets</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkBox" id="toolbar_main_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="homogeneous">True</property>
<property name="layout-style">expand</property>
<property name="spacing">5</property>
<child>
<object class="GtkButton" id="open_tool_button">
<object class="GtkButtonBox" id="osv_button_box">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Open</property>
<property name="action-name">app.on_data_open</property>
<property name="can-focus">False</property>
<property name="layout-style">expand</property>
<child>
<object class="GtkImage" id="open_image">
<object class="GtkButton" id="open_tool_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">document-open-symbolic</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Open</property>
<property name="action-name">app.on_data_open</property>
<child>
<object class="GtkImage" id="open_image">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">document-open-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="save_tool_button">
<property name="can-focus">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Save</property>
<property name="action-name">app.on_data_save</property>
<child>
<object class="GtkImage" id="save_image">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">document-save-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="receive_button">
<object class="GtkButtonBox" id="send_receive_button_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Download from the receiver</property>
<property name="action-name">app.on_receive</property>
<property name="always-show-image">True</property>
<property name="layout-style">expand</property>
<child>
<object class="GtkImage" id="download_image">
<property name="width-request">32</property>
<object class="GtkButton" id="receive_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">network-receive-symbolic</property>
<property name="icon_size">1</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Download from the receiver</property>
<property name="action-name">app.on_receive</property>
<property name="always-show-image">True</property>
<child>
<object class="GtkImage" id="download_image">
<property name="width-request">32</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">network-receive-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="send_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Transfer to receiver</property>
<property name="action-name">app.on_send</property>
<property name="always-show-image">True</property>
<child>
<object class="GtkImage" id="send_image">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">network-transmit-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="send_menu_button">
<property name="visible" bind-source="send_button" bind-property="visible" bind-flags="invert-boolean">False</property>
<property name="can-focus">False</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Transfer to receiver</property>
<property name="popover">send_popover</property>
<child>
<object class="GtkImage" id="send_menu_image">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">network-transmit-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="send_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Transfer to receiver</property>
<property name="action-name">app.on_send</property>
<property name="always-show-image">True</property>
<child>
<object class="GtkImage" id="send_image">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">network-transmit-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="save_tool_button">
<property name="can-focus">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Save</property>
<property name="action-name">app.on_data_save</property>
<child>
<object class="GtkImage" id="save_image">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">document-save-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">5</property>
</packing>
</child>
</object>

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -40,10 +40,10 @@ from urllib.parse import urlparse, unquote
from gi.repository import GLib, Gio, GObject
from app.commons import run_idle, log, run_task, run_with_delay, init_logger, DefaultDict
from app.connections import (HttpAPI, download_data, DownloadType, upload_data, STC_XML_FILE)
from app.connections import (HttpAPI, download_data, DownloadType, upload_data)
from app.eparser import get_blacklist, write_blacklist, write_bouquet
from app.eparser import get_services, get_bouquets, write_bouquets, write_services, Bouquets, Bouquet, Service
from app.eparser.ecommons import CAS, Flag, BouquetService
from app.eparser.ecommons import CAS, Flag, BouquetService, TrType
from app.eparser.enigma.bouquets import BqServiceType
from app.eparser.enigma.streamrelay import StreamRelay
from app.eparser.iptv import export_to_m3u, StreamType
@@ -69,7 +69,7 @@ from .iptv import (IptvDialog, SearchUnavailableDialog, IptvListConfigurationDia
from .main_helper import *
from .picons import PiconManager
from .search import SearchProvider
from .service_details_dialog import ServiceDetailsDialog, Action
from .service_dialog import ServiceDetailsDialog, Action
from .settings_dialog import SettingsDialog
from .uicommons import (Gtk, Gdk, UI_RESOURCES_PATH, LOCKED_ICON, HIDE_ICON, IPTV_ICON, MOVE_KEYS, KeyboardKey, Column,
MOD_MASK, APP_FONT, Page, HeaderBar, LINK_ICON)
@@ -79,7 +79,7 @@ from .xml.edit import SatellitesTool
class Application(Gtk.Application):
""" Main application class. """
VERSION = "3.11.3"
VERSION = "3.14.4"
SERVICE_MODEL = "services_list_store"
FAV_MODEL = "fav_list_store"
@@ -88,12 +88,13 @@ class Application(Gtk.Application):
IPTV_MODEL = "iptv_list_store"
DRAG_SEP = "::::"
MARKER_TYPES = {BqServiceType.MARKER.name, BqServiceType.SPACE.name, BqServiceType.ALT.name}
MARKER_TYPES = {BqServiceType.MARKER.name, BqServiceType.SPACE.name}
NON_REF_TYPES = {BqServiceType.MARKER.name, BqServiceType.SPACE.name, BqServiceType.ALT.name}
DEL_FACTOR = 100 # Batch size to delete in one pass.
FAV_FACTOR = DEL_FACTOR * 5
_TV_TYPES = ("TV", "TV (HD)", "TV (UHD)", "TV (H264)")
_TV_TYPES = {"TV", "TV (HD)", "TV (UHD)", "TV (H264)"}
BG_TASK_LIMIT = 5
@@ -102,7 +103,9 @@ class Application(Gtk.Application):
# Dynamically active elements depending on the selected view
_SERVICE_ELEMENTS = ("services_to_fav_end_move_popup_item", "services_to_fav_move_popup_item",
"services_create_bouquet_popup_item", "services_copy_popup_item", "services_edit_popup_item",
"services_add_new_popup_item", "services_picon_popup_item", "services_remove_popup_item")
"services_mark_not_in_bq_popup_item", "services_clear_not_in_bq_popup_item",
"services_clear_new_flag_item", "services_picon_popup_item", "services_remove_popup_item",
"services_reference_popup_item")
_FAV_ELEMENTS = ("fav_cut_popup_item", "fav_paste_popup_item", "fav_locate_popup_item", "fav_iptv_popup_item",
"fav_insert_marker_popup_item", "fav_insert_space_popup_item", "fav_edit_sub_menu_popup_item",
@@ -119,6 +122,7 @@ class Application(Gtk.Application):
_FAV_ENIGMA_ELEMENTS = ("fav_insert_marker_popup_item", "fav_epg_configuration_popup_item")
_FAV_IPTV_ELEMENTS = ("fav_iptv_popup_item", "iptv_menu_button")
_ALT_ELEMENTS = ("alt_paste_popup_item",)
DATA_SAVE_PAGES = {Page.SERVICES, Page.SATELLITE}
DATA_OPEN_PAGES = {Page.SERVICES, Page.SATELLITE, Page.PICONS, Page.EPG}
@@ -152,6 +156,7 @@ class Application(Gtk.Application):
"on_reference_assign": self.on_reference_assign,
"on_fav_paste": self.on_fav_paste,
"on_bouquets_paste": self.on_bouquets_paste,
"on_alt_paste": self.on_alt_paste,
"on_rename_for_bouquet": self.on_rename_for_bouquet,
"on_set_default_name_for_bouquet": self.on_set_default_name_for_bouquet,
"on_services_add_new": self.on_services_add_new,
@@ -172,6 +177,7 @@ class Application(Gtk.Application):
"on_view_drag_data_received": self.on_view_drag_data_received,
"on_bq_view_drag_data_received": self.on_bq_view_drag_data_received,
"on_alt_view_drag_data_received": self.on_alt_view_drag_data_received,
"on_alt_view_key_press": self.on_alt_view_key_press,
"on_view_press": self.on_view_press,
"on_view_release": self.on_view_release,
"on_view_popup_menu": self.on_view_popup_menu,
@@ -243,6 +249,8 @@ class Application(Gtk.Application):
self._is_data_open_enabled = True
self._is_data_extract_enabled = False
self._is_data_save_enabled = False
self._ext_data_path = None
self._arch_data_path = None
# Used for copy/paste. When adding the previous data will not be deleted.
# Clearing only after the insertion!
self._rows_buffer = []
@@ -392,6 +400,7 @@ class Application(Gtk.Application):
self._bq_name_label = builder.get_object("bq_name_label")
self._iptv_model = builder.get_object("iptv_list_store")
self._iptv_menu_button = builder.get_object("iptv_menu_button")
self._send_button = builder.get_object("send_button")
# Setting custom sort function for position column.
self._services_view.get_model().set_sort_func(Column.SRV_POS, self.position_sort_func, Column.SRV_POS)
# App info
@@ -417,9 +426,10 @@ class Application(Gtk.Application):
self._tv_count_label = builder.get_object("tv_count_label")
self._radio_count_label = builder.get_object("radio_count_label")
self._data_count_label = builder.get_object("data_count_label")
self._current_data_path_label = builder.get_object("current_data_path_label")
self._iptv_count_label = builder.get_object("iptv_count_label")
self._services_load_spinner = builder.get_object("services_load_spinner")
self._iptv_services_load_spinner = builder.get_object("iptv_services_load_spinner")
self._services_progress_bar = builder.get_object("services_progress_bar")
self._iptv_progress_bar = builder.get_object("iptv_progress_bar")
self._save_tool_button = builder.get_object("save_tool_button")
self.bind_property("is-data-save-enabled", self._save_tool_button, "visible")
self._receiver_info_box.bind_property("visible", self._http_status_image, "visible", 4)
@@ -456,9 +466,10 @@ class Application(Gtk.Application):
self._filter_types_model = builder.get_object("filter_types_list_store")
self._filter_sat_pos_model = builder.get_object("filter_sat_pos_list_store")
self._filter_bouquet_model = builder.get_object("filter_bouquet_list_store")
self._filter_only_free_button = builder.get_object("filter_only_free_button")
self._filter_all_button = builder.get_object("filter_all_button")
self._filter_free_button = builder.get_object("filter_free_button")
self._filter_coded_button = builder.get_object("filter_coded_button")
self._filter_not_in_bq_button = builder.get_object("filter_not_in_bq_button")
self._services_load_spinner.bind_property("active", self._filter_services_button, "sensitive", 4)
self._filter_iptv_services_button = builder.get_object("filter_iptv_services_button")
# Search.
services_search_provider = SearchProvider(self._services_view,
@@ -498,7 +509,7 @@ class Application(Gtk.Application):
self._record_image = builder.get_object("record_button_image")
# Dynamically active elements depending on the selected view.
d_elements = (self._SERVICE_ELEMENTS, self._BOUQUET_ELEMENTS, self._COMMONS_ELEMENTS, self._FAV_ELEMENTS,
self._FAV_ENIGMA_ELEMENTS, self._FAV_IPTV_ELEMENTS)
self._FAV_ENIGMA_ELEMENTS, self._FAV_IPTV_ELEMENTS, self._ALT_ELEMENTS)
self._tool_elements = {k: builder.get_object(k) for k in set(chain.from_iterable(d_elements))}
# Lock, Hide.
self._bouquet_lock_hide_box = builder.get_object("bouquet_lock_hide_box")
@@ -593,10 +604,6 @@ class Application(Gtk.Application):
iptv_button.bind_property("active", self._filter_iptv_services_button, "visible")
iptv_button.bind_property("active", self._iptv_search_button, "visible")
iptv_button.bind_property("active", builder.get_object("iptv_export_to_m3u_button"), "visible")
self._iptv_services_load_spinner.bind_property("active", self._filter_iptv_services_button, "sensitive", 4)
self._iptv_services_load_spinner.bind_property("active", self._profile_combo_box, "sensitive", 4)
self._iptv_services_load_spinner.bind_property("active", self._dvb_button, "sensitive", 4)
self._services_load_spinner.bind_property("active", self._iptv_button, "sensitive", 4)
self.connect("profile-changed", self.init_iptv)
self.connect("iptv-service-added", self.on_iptv_service_added)
self.connect("iptv-service-edited", self.on_iptv_service_edited)
@@ -715,18 +722,21 @@ class Application(Gtk.Application):
self.on_iptv_list_configuration, self.on_remove_all_unavailable):
iptv_elem.bind_property("sensitive", self.set_action(h.__name__, h, False), "enabled")
if self._settings.extensions_support:
self.init_extensions(builder)
self.init_extensions(builder)
def init_extensions(self, builder):
import pkgutil
from importlib.util import module_from_spec
from app.ui.extensions.management import ExtensionManager
# Extensions (Plugins) section.
ext_section = builder.get_object(f"{'mac_' if IS_DARWIN else ''}extension_section")
self.set_action("on_extension_manager", lambda a, v: ExtensionManager(self).show())
ext_section.append_item(Gio.MenuItem.new(translate("Extension Manager"), "app.on_extension_manager"))
if not self._settings.extensions_support:
return
import pkgutil
from importlib.util import module_from_spec
ext_path = f"{self._settings.default_data_path}tools{os.sep}extensions"
ext_paths = [f"{os.path.dirname(__file__)}{os.sep}extensions", ext_path, "extensions"]
extensions = {}
@@ -805,7 +815,7 @@ class Application(Gtk.Application):
# Open and download/upload data.
self.set_action("open_data", lambda a, v: self.open_data())
self.set_action("upload_all", lambda a, v: self.emit("data-send", self._page))
self.set_action("upload_bouquets", lambda a, v: self.on_upload_data(DownloadType.BOUQUETS))
self.set_action("upload_bouquets", self.on_upload_bouquets)
sa = self.set_action("on_data_save", lambda a, v: self.emit("data-save", self._page), False)
self.bind_property("is-data-save-enabled", sa, "enabled")
sa = self.set_action("on_data_save_as", lambda a, v: self.emit("data-save-as", self._page), False)
@@ -1098,7 +1108,17 @@ class Application(Gtk.Application):
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
return True
else:
GLib.idle_add(self.quit)
if len(self._task_box):
msg = f"{translate('There are running background tasks!')}\n\n\t\t{translate('Are you sure?')}"
if show_dialog(DialogType.QUESTION, self._main_window, msg) != Gtk.ResponseType.OK:
return True
log("Terminating the application...")
import signal
os.kill(os.getpid(), signal.SIGTERM)
GLib.idle_add(self.quit, priority=GLib.PRIORITY_HIGH)
return False
def on_main_window_state(self, window, event):
if event.new_window_state & Gdk.WindowState.FULLSCREEN or event.new_window_state & Gdk.WindowState.MAXIMIZED:
@@ -1166,6 +1186,7 @@ class Application(Gtk.Application):
def on_visible_page(self, stack, param):
self._page = Page(stack.get_visible_child_name())
self._send_button.set_visible(self._page is not Page.SERVICES)
self._fav_paned.set_visible(self._page in self._fav_pages)
self.is_data_save_enabled = self._page in self.DATA_SAVE_PAGES
self.is_data_open_enabled = self._page in self.DATA_OPEN_PAGES
@@ -1207,7 +1228,7 @@ class Application(Gtk.Application):
msg = translate("Restart the program to apply all changes.")
if value:
warn = "It can cause some problems."
warn = translate("It can cause some problems.")
msg = f"{translate('EXPERIMENTAL!')} {warn} {msg}"
self.show_info_message(msg, Gtk.MessageType.WARNING)
@@ -1281,7 +1302,7 @@ class Application(Gtk.Application):
def fav_service_data_func(self, column, renderer, model, itr, data):
if self._display_epg and self._s_type is SettingsType.ENIGMA_2:
srv_name = model.get_value(itr, Column.FAV_SERVICE)
if model.get_value(itr, Column.FAV_TYPE) in self.MARKER_TYPES:
if model.get_value(itr, Column.FAV_TYPE) in self.NON_REF_TYPES:
return True
event = self._epg_cache.get_current_event(srv_name)
@@ -1378,6 +1399,8 @@ class Application(Gtk.Application):
self.fav_paste(selection)
elif target is ViewTarget.BOUQUET:
self.bouquet_paste(selection)
elif target is ViewTarget.ALT:
self.alt_paste()
self.on_view_focus(view)
def fav_paste(self, selection):
@@ -1464,7 +1487,7 @@ class Application(Gtk.Application):
priority = GLib.PRIORITY_LOW
if model_name == self.FAV_MODEL:
gen = self.remove_favs(itrs, model)
gen = self.remove_favorites(itrs, model)
elif model_name == self.BQ_MODEL:
gen = self.delete_bouquets(itrs, model)
priority = GLib.PRIORITY_DEFAULT
@@ -1480,18 +1503,24 @@ class Application(Gtk.Application):
return rows
def remove_favs(self, itrs, model):
def remove_favorites(self, itrs, model):
""" Deleting bouquet services. """
if self._bq_selected:
fav_bouquet = self._bouquets.get(self._bq_selected, None)
if fav_bouquet:
removed = []
for index, itr in enumerate(itrs):
del fav_bouquet[int(model.get_path(itr)[0])]
path = model.get_path(itr)
p_index = int(path[0])
removed.append((p_index, tuple(model[path])))
del fav_bouquet[p_index]
self._fav_model.remove(itr)
if index % self.DEL_FACTOR == 0:
yield True
self.update_fav_num_column(model)
self.emit("fav-removed", self._bq_selected)
self.emit("fav-removed", removed)
self.on_model_changed(self._fav_model)
self._wait_dialog.hide()
@@ -2121,11 +2150,15 @@ class Application(Gtk.Application):
name, model = get_model_data(view)
self.delete_views_selection(name)
elif event.get_event_type() == Gdk.EventType.DOUBLE_BUTTON_PRESS and event.button == Gdk.BUTTON_PRIMARY:
self._select_enabled = True
if self._settings.main_list_playback and self._fav_click_mode is not PlaybackMode.DISABLED:
if view is self._services_view:
self.emit("srv-clicked", self._fav_click_mode)
elif view is self._iptv_services_view:
self.emit("iptv-clicked", self._fav_click_mode)
else:
if view is not self._fav_view:
self.on_edit()
def on_view_release(self, view, event):
""" Handles a mouse click (release) to view. """
@@ -2155,6 +2188,8 @@ class Application(Gtk.Application):
elif name == "bouquets_popup_menu":
self.delete_selection(self._services_view, self._fav_view)
self.on_view_focus(self._bouquets_view)
elif name == "alt_popup_menu":
self.on_view_focus(self._alt_view)
menu.popup(None, None, None, None, event.button, event.time)
return True
@@ -2187,6 +2222,10 @@ class Application(Gtk.Application):
elif page is Page.SERVICES:
self.on_upload_data(DownloadType.SERVICES)
def on_upload_bouquets(self, action, value=None):
self.change_action_state("on_logs_show", GLib.Variant.new_boolean(True))
self.on_upload_data(DownloadType.BOUQUETS)
def on_bg_task_add(self, app, task):
if len(self._task_box) <= self.BG_TASK_LIMIT:
self._task_box.add(task)
@@ -2203,7 +2242,7 @@ class Application(Gtk.Application):
self.on_task_done(app, task)
@run_task
def on_download_data(self, download_type=DownloadType.ALL):
def on_download_data(self, download_type=DownloadType.ALL, files_filter=None):
backup, backup_src, data_path = self._settings.backup_before_downloading, None, None
try:
if backup and download_type is not DownloadType.SATELLITES:
@@ -2211,7 +2250,7 @@ class Application(Gtk.Application):
backup_path = self._settings.profile_backup_path or self._settings.default_backup_path
backup_src = backup_data(data_path, backup_path, download_type is DownloadType.ALL)
download_data(settings=self._settings, download_type=download_type)
download_data(settings=self._settings, download_type=download_type, files_filter=files_filter)
except Exception as e:
msg = "Downloading data error: {}"
log(msg.format(e), debug=self._settings.debug_mode, fmt_message=msg)
@@ -2224,22 +2263,26 @@ class Application(Gtk.Application):
else:
GLib.idle_add(self.open_data)
def on_upload_data(self, download_type=DownloadType.ALL):
def on_upload_data(self, download_type=DownloadType.ALL, files_filter=None):
if not self.is_data_saved():
gen = self.save_data(lambda: self.upload_data(download_type))
gen = self.save_data(lambda: self.upload_data(download_type, files_filter=files_filter))
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
else:
self.upload_data(download_type)
self.upload_data(download_type, files_filter=files_filter)
@run_task
def upload_data(self, download_type):
def upload_data(self, download_type, files_filter=None):
opts = self._settings
multiple = len(self._settings.hosts) > 1
for host in self._settings.hosts:
if multiple:
log(f"##### Uploading data on [{host}] #####")
try:
upload_data(settings=opts, download_type=download_type, ext_host=host)
upload_data(settings=opts,
download_type=download_type,
files_filter=files_filter,
ext_host=host,
ext_path=self._ext_data_path)
except Exception as e:
msg = "Uploading data error: {}"
log(msg.format(e), debug=self._settings.debug_mode, fmt_message=msg)
@@ -2253,6 +2296,7 @@ class Application(Gtk.Application):
response = show_dialog(DialogType.CHOOSER, self._main_window, settings=self._settings, title="Open folder")
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
return
self.open_data(response)
def on_data_extract(self, app, page):
@@ -2285,9 +2329,9 @@ class Application(Gtk.Application):
def open_compressed_data(self, data_path):
""" Opening archived data. """
arch_path = self.get_archive_path(data_path)
if arch_path:
gen = self.update_data(f"{arch_path.name}{os.sep}", callback=arch_path.cleanup)
self._arch_data_path = self.get_archive_path(data_path)
if self._arch_data_path:
gen = self.update_data(f"{self._arch_data_path.name}{os.sep}")
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
def get_archive_path(self, data_path):
@@ -2322,12 +2366,13 @@ class Application(Gtk.Application):
return tmp_path
def update_data(self, data_path, callback=None):
self._services_load_spinner.start()
self._ext_data_path = data_path
self.on_info_bar_close()
self._profile_combo_box.set_sensitive(False)
self._alt_revealer.set_visible(False)
self._filter_services_button.set_active(False)
self._wait_dialog.show()
self._services_progress_bar.show()
yield from self.clear_current_data()
# Reset of sorting
@@ -2345,42 +2390,36 @@ class Application(Gtk.Application):
self.init_profiles()
data_path = self._settings.profile_data_path if data_path is None else data_path
self._current_data_path_label.set_text(data_path)
local_path = self._settings.profile_data_path
os.makedirs(os.path.dirname(local_path), exist_ok=True)
if data_path != local_path:
from shutil import copyfile
for f in STC_XML_FILE:
xml_src = data_path + f
if os.path.isfile(xml_src):
copyfile(xml_src, local_path + f)
prf = self._s_type
black_list = get_blacklist(data_path)
self._stream_relay.refresh(data_path)
bouquets = get_bouquets(data_path, prf)
bouquets, errors = get_bouquets(data_path, prf)
if errors:
msg = translate('There were errors [%s] during bouquets loading!') % errors
self.show_info_message(f"{msg} {translate('Check the log for more info.')}", Gtk.MessageType.WARNING)
yield True
services = get_services(data_path, prf, self.get_format_version() if prf is SettingsType.ENIGMA_2 else 0)
yield True
except FileNotFoundError as e:
msg = translate("Please, download files from receiver or setup your path for read data!")
self.show_error_message(getattr(e, "message", str(e)) + "\n\n" + msg)
self._services_load_spinner.stop()
return
except SyntaxError as e:
self.show_error_message(str(e))
self._services_load_spinner.stop()
return
except Exception as e:
msg = "Reading data error: {}"
log(msg.format(e), debug=self._settings.debug_mode, fmt_message=msg)
self.show_error_message("{}\n{}".format(translate("Reading data error!"), e))
self._services_load_spinner.stop()
return
else:
self.append_blacklist(black_list)
yield from self.append_data(bouquets, services)
data_gen = self.append_data(bouquets, services)
yield from data_gen
if callback:
callback()
yield True
@@ -2392,13 +2431,15 @@ class Application(Gtk.Application):
finally:
self._profile_combo_box.set_sensitive(True)
self._wait_dialog.hide()
self._services_progress_bar.hide()
self.emit("data-load-done", self._settings.current_profile)
def append_data(self, bouquets, services):
if self._app_info_box.get_visible():
yield from self.show_app_info(False)
self.append_bouquets(bouquets)
yield from self.append_services(services)
s_gen = self.append_services(services)
yield from s_gen
self.update_sat_positions()
yield True
@@ -2457,36 +2498,27 @@ class Application(Gtk.Application):
bouquet = self._bouquets_model.append(parent, [name, locked, hidden, bq_type])
bq_id = f"{name}:{bq_type}"
services = []
extra_services = {} # for services with different names in bouquet and main list
extra_services = {} # For services with different names in the bouquet and main list.
agr = [None] * 7
for srv in bq.services:
fav_id = srv.data
# IPTV and MARKER services
s_type = srv.type
if s_type in (BqServiceType.MARKER, BqServiceType.IPTV, BqServiceType.SPACE):
icon = None
picon_id = None
data_id = srv.num
locked = None
if s_type is BqServiceType.IPTV:
fav_id_data = fav_id.lstrip().split(":")
if len(fav_id_data) > 10:
data_id = ":".join(fav_id_data[:11])
picon_id = "{}_{}_{}_{}_{}_{}_{}_{}_{}_{}.png".format(*fav_id_data[:10])
icon = LINK_ICON if data_id in self._stream_relay else IPTV_ICON
locked = LOCKED_ICON if data_id in self._blacklist else None
srv = Service(None, None, icon, srv.name, locked, None, None, s_type.name,
self._picons.get(picon_id, None), picon_id, *agr, data_id, fav_id, None)
self._services[fav_id] = srv
# Markers and spaces.
if s_type in (BqServiceType.MARKER, BqServiceType.SPACE):
self._services[fav_id] = Service(None, None, None, srv.name, None, None, None,
s_type.name, None, None, *agr, srv.num, fav_id, None)
# IPTV services.
elif s_type is BqServiceType.IPTV:
self._services[fav_id] = self.get_bq_iptv_service(srv, agr)
# Alternatives.
elif s_type is BqServiceType.ALT:
self._alt_file.add(f"{srv.data}:{bq_type}")
srv = Service(None, None, None, srv.name, locked, None, None, s_type.name,
None, None, *agr, srv.data, fav_id, srv.num)
self._services[fav_id] = srv
self._services[fav_id] = Service(None, None, None, srv.name, locked, None, None, s_type.name,
None, None, *agr, srv.data, fav_id, srv.num)
for s in filter(lambda x: x.type is BqServiceType.IPTV, srv[-1]):
iptv_srv = self.get_bq_iptv_service(s, agr)
self._services[iptv_srv.fav_id] = iptv_srv
elif s_type is BqServiceType.BOUQUET:
# Sub bouquets!
self.append_bouquet(srv.data, bouquet)
elif srv.name:
extra_services[fav_id] = srv.name
@@ -2497,6 +2529,24 @@ class Application(Gtk.Application):
if extra_services:
self._extra_bouquets[bq_id] = extra_services
def get_bq_iptv_service(self, srv, agr):
fav_id = srv.data
data_id = srv.num
picon_id = None
icon = None
locked = None
fav_id_data = fav_id.lstrip().split(":")
if len(fav_id_data) > 10:
data_id = ":".join(fav_id_data[:11])
picon_id = "{}_{}_{}_{}_{}_{}_{}_{}_{}_{}.png".format(*fav_id_data[:10])
icon = LINK_ICON if data_id in self._stream_relay else IPTV_ICON
locked = LOCKED_ICON if data_id in self._blacklist else None
return Service(None, None, icon, srv.name, locked, None, None, srv.type.name,
self._picons.get(picon_id, None), picon_id, *agr, data_id, fav_id, None)
@run_idle
def open_last_bouquet(self, app, profile):
""" Loads the last opened bouquet. """
@@ -2519,33 +2569,38 @@ class Application(Gtk.Application):
to_add.append(srv)
# Adding channels to dict with fav_id as keys.
self._services[srv.fav_id] = srv
self.update_services_counts(len(self._services.values()))
self._wait_dialog.hide()
factor = self.DEL_FACTOR / 4
size = len(to_add)
for index, srv in enumerate(to_add):
background = self.get_new_background(srv.flags_cas)
s = srv + (None, background)
self._services_model.append(s)
if index % factor == 0:
self._services_progress_bar.set_fraction(index / size)
yield True
self._services_load_spinner.stop()
yield True
def append_iptv_data(self, services=None):
self._iptv_services_load_spinner.start()
self._iptv_progress_bar.show()
services = services or self._services.values()
services = [s for s in services if s.service_type == BqServiceType.IPTV.name]
size = len(services)
for index, s in enumerate(filter(lambda x: x.service_type == BqServiceType.IPTV.name, services), start=1):
for index, s in enumerate(services, start=1):
ref, url = get_iptv_data(s.fav_id)
self._iptv_model.append((s.service, None, None, ref, url, s.fav_id, s.picon_id, None))
if index % self.DEL_FACTOR == 0:
self._iptv_count_label.set_text(str(index))
self._iptv_progress_bar.set_fraction(index / size)
yield True
self._iptv_count_label.set_text(str(len(self._iptv_model)))
self._iptv_services_load_spinner.stop()
self._iptv_progress_bar.hide()
yield True
def get_new_background(self, flags):
@@ -2630,7 +2685,7 @@ class Application(Gtk.Application):
def save_data(self, callback=None, ext_path=None):
self._save_tool_button.set_sensitive(False)
profile = self._s_type
path = ext_path or self._settings.profile_data_path
path = ext_path or self._ext_data_path or self._settings.profile_data_path
backup_path = self._settings.profile_backup_path
# Backup data or clearing data path
backup_data(path, backup_path) if not ext_path and self._settings.backup_before_save else clear_data_path(path)
@@ -2749,7 +2804,7 @@ class Application(Gtk.Application):
self._alt_revealer.set_visible(False)
self.on_info_bar_close()
if self._page is Page.EPG and srv.service_type not in self.MARKER_TYPES:
if self._page is Page.EPG and srv.service_type not in self.NON_REF_TYPES:
self.emit("fav-changed", srv)
def on_services_selection(self, model, path, column):
@@ -2761,7 +2816,8 @@ class Application(Gtk.Application):
if not cas:
return
cvs = list(filter(lambda val: val.startswith("C:") and len(val) > 3, cas.split(",")))
self._cas_label.set_text(", ".join(map(str, sorted(set(CAS.get(v[:4].upper(), def_val) for v in cvs)))))
cas = sorted(set(CAS.get(v.upper(), CAS.get(v[:4].upper(), def_val)) for v in cvs))
self._cas_label.set_text(", ".join(map(str, cas)))
def on_bouquets_selection(self, model, path, column):
self.reset_view_sort_indication(self._fav_view)
@@ -2932,11 +2988,10 @@ class Application(Gtk.Application):
def on_tree_view_key_press(self, view, event):
""" Handling keystrokes on press """
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
return
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return False
key = KeyboardKey(key_code)
ctrl = event.state & MOD_MASK
if key is KeyboardKey.F:
if ctrl:
@@ -2985,11 +3040,10 @@ class Application(Gtk.Application):
def on_tree_view_key_release(self, view, event):
""" Handling keystrokes on release """
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
ctrl = event.state & MOD_MASK
shift = event.state & Gdk.ModifierType.SHIFT_MASK
model_name, model = get_model_data(view)
@@ -3035,6 +3089,10 @@ class Application(Gtk.Application):
self._tool_elements[elem].set_sensitive(not_empty)
if elem == "bouquets_paste_popup_item":
self._tool_elements[elem].set_sensitive(not_empty and self._bouquets_buffer)
elif model_name == self.ALT_MODEL:
for elem in self._ALT_ELEMENTS:
if elem == "alt_paste_popup_item":
self._tool_elements[elem].set_sensitive(not is_service and self._rows_buffer)
else:
for elem in self._FAV_ELEMENTS:
if elem in ("paste_tool_button", "fav_paste_popup_item"):
@@ -3043,18 +3101,15 @@ class Application(Gtk.Application):
self._tool_elements[elem].set_sensitive(self._bq_selected and not is_service)
else:
self._tool_elements[elem].set_sensitive(not_empty and not is_service)
for elem in self._SERVICE_ELEMENTS:
self._tool_elements[elem].set_sensitive(not_empty and is_service)
for elem in self._BOUQUET_ELEMENTS:
self._tool_elements[elem].set_sensitive(False)
[self._tool_elements[elem].set_sensitive(not_empty and is_service) for elem in self._SERVICE_ELEMENTS]
[self._tool_elements[elem].set_sensitive(False) for elem in self._BOUQUET_ELEMENTS]
for elem in self._FAV_IPTV_ELEMENTS:
is_iptv = self._bq_selected and not is_service
if self._s_type is SettingsType.NEUTRINO_MP:
is_iptv = is_iptv and BqType(self._bq_selected.split(":")[1]) is BqType.WEBTV
self._tool_elements[elem].set_sensitive(is_iptv)
for elem in self._COMMONS_ELEMENTS:
self._tool_elements[elem].set_sensitive(not_empty)
[self._tool_elements[elem].set_sensitive(not_empty) for elem in self._COMMONS_ELEMENTS]
if self._s_type is not SettingsType.ENIGMA_2:
for elem in self._FAV_ENIGMA_ELEMENTS:
@@ -3126,9 +3181,9 @@ class Application(Gtk.Application):
def on_fav_press(self, menu, event):
if event.get_event_type() == Gdk.EventType.DOUBLE_BUTTON_PRESS:
if self._fav_click_mode is PlaybackMode.DISABLED:
return
self.emit("fav-clicked", self._fav_click_mode)
self.on_service_edit(self._fav_view)
else:
self.emit("fav-clicked", self._fav_click_mode)
else:
return self.on_view_popup_menu(menu, event)
@@ -3213,7 +3268,7 @@ class Application(Gtk.Application):
fav_bqt = self._bouquets.get(self._bq_selected, None)
response = SearchUnavailableDialog(self._main_window, self._fav_model, fav_bqt, iptv_rows, self._s_type).show()
if response:
gen = self.remove_favs(response, self._fav_model)
gen = self.remove_favorites(response, self._fav_model)
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
def on_reference_assign(self, view):
@@ -3644,7 +3699,7 @@ class Application(Gtk.Application):
row = self._fav_model[path][:]
srv_type, fav_id = row[Column.FAV_TYPE], row[Column.FAV_ID]
if srv_type in self.MARKER_TYPES and show_error:
if srv_type in self.NON_REF_TYPES and show_error:
self.show_error_message("Not allowed in this context!")
return
@@ -3828,7 +3883,7 @@ class Application(Gtk.Application):
def filter_set_default(self):
""" Setting defaults for filter elements. """
self._filter_entry.set_text("")
self._filter_only_free_button.set_active(False)
self._filter_all_button.set_active(True)
self._filter_not_in_bq_button.set_active(False)
self._filter_types_model.foreach(lambda m, p, i: m.set_value(i, 1, True))
self._service_types.update({r[0] for r in self._filter_types_model})
@@ -3879,7 +3934,7 @@ class Application(Gtk.Application):
@run_with_delay(1)
def on_filter_changed(self, item=None):
self._services_load_spinner.start()
self._services_progress_bar.show()
self.update_filter_cache()
self.update_filter_state()
@@ -3909,7 +3964,7 @@ class Application(Gtk.Application):
yield True
view.set_model(main_model)
GLib.idle_add(self._services_load_spinner.stop)
GLib.idle_add(self._services_progress_bar.hide)
def update_filter_cache(self):
self._filter_cache.clear()
@@ -3919,7 +3974,12 @@ class Application(Gtk.Application):
txt = self._filter_entry.get_text().upper()
for r in self._services_model:
fav_id = r[Column.SRV_FAV_ID]
free = not r[Column.SRV_CODED] if self._filter_only_free_button.get_active() else True
free = True
if self._filter_free_button.get_active():
free = not r[Column.SRV_CODED]
elif self._filter_coded_button.get_active():
free = r[Column.SRV_CODED]
self._filter_cache[fav_id] = all((free, fav_id not in self._in_bouquets,
r[Column.SRV_TYPE] in self._service_types,
r[Column.SRV_POS] in self._sat_positions,
@@ -3999,7 +4059,7 @@ class Application(Gtk.Application):
if srv_type == BqServiceType.ALT.name:
return self.show_error_message("Operation not allowed in this context!")
if srv_type in self.MARKER_TYPES:
if srv_type in self.NON_REF_TYPES:
return self.on_rename(view)
elif srv_type == BqServiceType.IPTV.name:
return self.on_iptv_service_edit(model[paths][Column.FAV_ID], view)
@@ -4010,10 +4070,14 @@ class Application(Gtk.Application):
if model_name == self.IPTV_MODEL:
self.on_iptv_service_edit(model[paths][Column.IPTV_FAV_ID], view)
else:
ServiceDetailsDialog(self, self._NEW_COLOR).show()
ServiceDetailsDialog(self).show()
def on_services_add_new(self, item):
ServiceDetailsDialog(self, action=Action.ADD).show()
if self._s_type is SettingsType.NEUTRINO_MP:
self.show_error_message("Neutrino at the moment not supported!")
return
ServiceDetailsDialog(self, action=Action.ADD, tr_type=TrType(item.get_name())).show()
def on_bouquets_edit(self, view):
""" Renaming bouquets. """
@@ -4125,7 +4189,7 @@ class Application(Gtk.Application):
""" Marks services with duplicate [names] in the fav list. """
from collections import Counter
dup = Counter(r[Column.FAV_SERVICE] for r in self._fav_model if r[Column.FAV_TYPE] not in self.MARKER_TYPES)
dup = Counter(r[Column.FAV_SERVICE] for r in self._fav_model if r[Column.FAV_TYPE] not in self.NON_REF_TYPES)
dup = {k for k, v in dup.items() if v > 1}
for r in self._fav_model:
@@ -4146,7 +4210,7 @@ class Application(Gtk.Application):
if count:
if show_dialog(DialogType.QUESTION, self._main_window) != Gtk.ResponseType.OK:
return
gen = self.remove_favs(to_remove, self._fav_model)
gen = self.remove_favorites(to_remove, self._fav_model)
GLib.idle_add(lambda: next(gen, False))
self.show_info_message(f"{translate('Done!')} {translate('Removed')}: {count}")
else:
@@ -4161,7 +4225,7 @@ class Application(Gtk.Application):
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
def mark_not_in_bouquets(self):
self._services_load_spinner.start()
self._services_progress_bar.show()
ids = set(chain.from_iterable(self._bouquets.values()))
for index, row in enumerate(self._services_model):
@@ -4172,7 +4236,7 @@ class Application(Gtk.Application):
if index % self.FAV_FACTOR == 0:
yield True
self._services_load_spinner.stop()
self._services_progress_bar.hide()
yield True
def on_services_clear_marked(self, item):
@@ -4184,13 +4248,13 @@ class Application(Gtk.Application):
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
def clear_marked(self):
self._services_load_spinner.start()
self._services_progress_bar.show()
for index, row in enumerate(self._services_model):
row[Column.SRV_BACKGROUND] = self.get_new_background(row[Column.SRV_CAS_FLAGS])
if index % self.FAV_FACTOR == 0:
yield True
self._services_load_spinner.stop()
self._services_progress_bar.hide()
yield True
def on_services_clear_new_marked(self, item):
@@ -4207,7 +4271,7 @@ class Application(Gtk.Application):
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
def clear_new_marked(self, model, paths):
self._services_load_spinner.start()
self._services_progress_bar.show()
paths = get_base_paths(paths, model)
model = get_base_model(model)
@@ -4238,7 +4302,7 @@ class Application(Gtk.Application):
yield True
self.show_info_message("Done!", Gtk.MessageType.INFO)
self._services_load_spinner.stop()
self._services_progress_bar.hide()
yield True
# ***************** Picons ********************* #
@@ -4389,6 +4453,9 @@ class Application(Gtk.Application):
model.set(model.get_iter(paths), data)
self._fav_view.row_activated(paths[0], self._fav_view.get_column(Column.FAV_NUM))
def on_alt_paste(self, item):
self.on_paste(self._alt_view, ViewTarget.ALT)
def delete_alts(self, itrs, model, rows):
""" Deleting alternatives. """
list(map(model.remove, itrs))
@@ -4430,6 +4497,8 @@ class Application(Gtk.Application):
itr_str, sep, source = txt.partition(self.DRAG_SEP)
if source == self.SERVICE_MODEL:
model, id_col, t_col = self._services_view.get_model(), Column.SRV_FAV_ID, Column.SRV_TYPE
elif source == self.IPTV_MODEL:
model, id_col, t_col = self._iptv_services_view.get_model(), Column.IPTV_FAV_ID, Column.IPTV_TYPE
elif source == self.FAV_MODEL:
model, id_col, t_col = self._fav_view.get_model(), Column.FAV_ID, Column.FAV_TYPE
elif source == self.ALT_MODEL:
@@ -4443,20 +4512,8 @@ class Application(Gtk.Application):
itrs = tuple(model.get_iter_from_string(itr) for itr in itr_str.split(","))
types = {BqServiceType.MARKER.name, BqServiceType.SPACE.name, BqServiceType.ALT.name}
ids = tuple(model.get_value(itr, id_col) for itr in itrs if model.get_value(itr, t_col) not in types)
srvs = tuple(self._services.get(f_id, None) for f_id in ids)
dt, it = BqServiceType.DEFAULT, BqServiceType.IPTV
a_srvs = tuple(BouquetService(None, dt if s.service_type != it.name else it, s.fav_id, 0) for s in srvs)
alt_services = srv.transponder + a_srvs
self._services[srv.fav_id] = srv._replace(transponder=alt_services)
a_row = self._alt_model[self._alt_model.get_iter_first()][:]
alt_id, a_itr = a_row[Column.ALT_ID], a_row[Column.ALT_ITER]
for i, srv in enumerate(srvs, start=len(self._alt_model) + 1):
pic = self._picons.get(srv.picon_id, None)
self._alt_model.append((i, pic, srv.service, srv.service_type, srv.pos, srv.fav_id, alt_id, a_itr))
return True
return self.append_alt_services(srv, tuple(self._services.get(f_id, None) for f_id in ids))
def on_alt_move(self, s_iters, info, srv):
""" Move alternatives in the list. """
@@ -4492,6 +4549,40 @@ class Application(Gtk.Application):
if srv and srv.transponder or row[Column.ALT_TYPE] == BqServiceType.IPTV.name:
self.emit("fav-changed", srv)
def on_alt_view_key_press(self, view, event):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
ctrl = event.state & MOD_MASK
if ctrl and key == KeyboardKey.V:
self.alt_paste()
elif key == KeyboardKey.DELETE:
self.on_delete(view)
def alt_paste(self):
srv = self._services.get(self._alt_model.get_value(self._alt_model.get_iter_first(), Column.ALT_ID), None)
if not srv:
return
self.append_alt_services(srv, tuple(self._services.get(r[Column.FAV_ID]) for r in self._rows_buffer))
self._rows_buffer.clear()
def append_alt_services(self, srv, srvs):
dt, it = BqServiceType.DEFAULT, BqServiceType.IPTV
a_srvs = tuple(BouquetService(None, dt if s.service_type != it.name else it, s.fav_id, 0) for s in srvs)
alt_services = srv.transponder + a_srvs
self._services[srv.fav_id] = srv._replace(transponder=alt_services)
a_row = self._alt_model[self._alt_model.get_iter_first()][:]
alt_id, a_itr = a_row[Column.ALT_ID], a_row[Column.ALT_ITER]
for i, srv in enumerate(srvs, start=len(self._alt_model) + 1):
pic = self._picons.get(srv.picon_id, None)
self._alt_model.append((i, pic, srv.service, srv.service_type, srv.pos, srv.fav_id, alt_id, a_itr))
return True
# ***************** Stream relay ********************** #
def on_use_streamrelay(self, item):
@@ -4567,8 +4658,8 @@ class Application(Gtk.Application):
self._info_bar.set_visible(False)
def is_data_loading(self):
is_services_loading = self._services_load_spinner.get_property("active")
return is_services_loading or self._iptv_services_load_spinner.get_property("active")
is_services_loading = self._services_progress_bar.get_visible()
return is_services_loading or self._iptv_progress_bar.get_visible()
def is_data_saved(self):
if self._data_hash != 0 and self._data_hash != self.get_data_hash():

View File

@@ -347,7 +347,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkCheckButton" id="info_check_button">
<property name="visible">True</property>
<property name="visible" bind-source="filter_button" bind-property="visible">True</property>
<property name="can-focus">False</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Details</property>
@@ -413,12 +413,13 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkBox" id="header_download_box">
<property name="visible">True</property>
<property name="visible" bind-source="cancel_button" bind-property="visible" bind-flags="invert-boolean">True</property>
<property name="visible" bind-source="convert_button" bind-property="visible" bind-flags="invert-boolean">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkMenuButton" id="add_menu_button">
<property name="visible">True</property>
<property name="visible" bind-source="manager_button" bind-property="active">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
@@ -440,6 +441,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkButton" id="receive_button">
<property name="visible" bind-source="download_source_button" bind-property="visible">False</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="receives-default">False</property>
@@ -462,7 +464,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkButton" id="remove_button">
<property name="visible">True</property>
<property name="visible" bind-source="filter_button" bind-property="visible">True</property>
<property name="can-focus">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Remove all picons from the receiver</property>
@@ -490,7 +492,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkToggleButton" id="src_button">
<property name="visible">True</property>
<property name="visible" bind-source="filter_button" bind-property="visible">True</property>
<property name="can-focus">False</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Additional source</property>
@@ -529,6 +531,7 @@ Author: Dmitriy Yefremov
<property name="spacing">5</property>
<child>
<object class="GtkBox" id="filter_bar">
<property name="visible" bind-source="filter_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="spacing">5</property>
@@ -591,6 +594,7 @@ Author: Dmitriy Yefremov
<property name="wide-handle">True</property>
<child>
<object class="GtkFrame" id="src_picon_box_frame">
<property name="visible" bind-source="src_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.49000000953674316</property>
<property name="shadow-type">none</property>
@@ -607,6 +611,7 @@ Author: Dmitriy Yefremov
<child>
<object class="GtkCheckButton" id="src_filter_button">
<property name="label" translatable="yes">Filter</property>
<property name="visible" bind-source="filter_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="focus-on-click">False</property>
<property name="receives-default">False</property>
@@ -741,6 +746,7 @@ Author: Dmitriy Yefremov
<child>
<object class="GtkCheckButton" id="dst_filter_button">
<property name="label" translatable="yes">Filter</property>
<property name="visible" bind-source="filter_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="focus-on-click">False</property>
<property name="receives-default">False</property>
@@ -849,6 +855,7 @@ Author: Dmitriy Yefremov
</child>
<child type="label">
<object class="GtkLabel" id="explorer_dst_label">
<property name="visible" bind-source="src_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Destination:</property>
</object>
@@ -868,6 +875,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkFrame" id="explorer_info_box_frame">
<property name="visible" bind-source="info_check_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="label-xalign">0</property>
<property name="shadow-type">in</property>
@@ -952,7 +960,7 @@ Author: Dmitriy Yefremov
<property name="margin-bottom">5</property>
<child>
<object class="GtkComboBoxText" id="download_source_button">
<property name="sensitive">False</property>
<property name="sensitive" bind-source="satellite_label" bind-property="visible">False</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Source:</property>
<property name="active">0</property>
@@ -1026,7 +1034,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkLabel" id="loading_data_label">
<property name="visible">True</property>
<property name="visible" bind-source="satellite_label" bind-property="visible" bind-flags="invert-boolean">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Loading data...</property>
<property name="ellipsize">end</property>
@@ -1039,10 +1047,10 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkSpinner" id="loading_data_spinner">
<property name="visible">True</property>
<property name="visible" bind-source="satellite_label" bind-property="visible" bind-flags="invert-boolean">True</property>
<property name="can-focus">False</property>
<property name="margin-right">5</property>
<property name="active">True</property>
<property name="active" bind-source="satellite_label" bind-property="visible" bind-flags="invert-boolean">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1055,6 +1063,7 @@ Author: Dmitriy Yefremov
<object class="GtkGrid" id="satellite_filter_grid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Filter by current satellite positions</property>
<property name="margin-right">5</property>
<property name="column-spacing">5</property>
<child>
@@ -1072,7 +1081,6 @@ Author: Dmitriy Yefremov
<object class="GtkSwitch" id="satellite_filter_switch">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="active">True</property>
<signal name="state-set" handler="on_satellite_filter_toggled" swapped="no"/>
</object>
<packing>
@@ -1103,6 +1111,7 @@ Author: Dmitriy Yefremov
<child>
<object class="GtkTreeView" id="satellites_view">
<property name="visible">True</property>
<property name="sensitive" bind-source="satellite_label" bind-property="visible">False</property>
<property name="can-focus">True</property>
<property name="model">satellites_list_store</property>
<property name="headers-visible">False</property>
@@ -1571,110 +1580,24 @@ Author: Dmitriy Yefremov
<object class="GtkBox" id="converter_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<property name="spacing">5</property>
<child>
<!-- n-columns=3 n-rows=4 -->
<object class="GtkGrid" id="converter_grid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">10</property>
<property name="margin-right">10</property>
<property name="margin-top">10</property>
<property name="row-spacing">5</property>
<property name="column-spacing">2</property>
<property name="column-homogeneous">True</property>
<child>
<object class="GtkFileChooserButton" id="enigma2_path_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action">select-folder</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="picons_path_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Path to Enigma2 picons:</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="save_to_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Path to save:</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="save_to_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action">select-folder</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="convert_to_label">
<property name="visible">True</property>
<object class="GtkLabel" id="convert_to_nt_label">
<property name="visible" bind-source="converter_nt_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="margin-bottom">10</property>
<property name="label" translatable="yes">Enigma2 -&gt; Neutrino-MP</property>
<property name="label">Enigma2 -&gt; Neutrino-MP</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
<child>
@@ -1688,9 +1611,154 @@ Author: Dmitriy Yefremov
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="convert_to_sc_label">
<property name="visible" bind-source="converter_sc_button" bind-property="active">True</property>
<property name="can-focus">False</property>
<property name="margin-bottom">10</property>
<property name="label">Enigma2 -&gt; OSCam</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="converter_format_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">center</property>
<property name="margin-top">10</property>
<property name="homogeneous">True</property>
<property name="layout-style">expand</property>
<child>
<object class="GtkRadioButton" id="converter_sc_button">
<property name="label" translatable="yes">OSCam</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">False</property>
<property name="group">converter_nt_button</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="converter_nt_button">
<property name="label" translatable="yes">Neutrino-MP</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">False</property>
<property name="group">converter_sc_button</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="converter_select_bq_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel" id="coverter_bq_label">
<property name="label" translatable="yes">Convert for selected bouquets</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="converter_bq_button">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="picons_path_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Path to Enigma2 picons:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="enigma2_path_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action">select-folder</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="save_to_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Path to save:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="save_to_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action">select-folder</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">7</property>
</packing>
</child>
</object>
</child>
<child type="label_item">
@@ -1807,7 +1875,7 @@ Author: Dmitriy Yefremov
<property name="margin-bottom">2</property>
<child>
<object class="GtkLabel" id="manager_label">
<property name="visible">True</property>
<property name="visible" bind-source="manager_button" bind-property="active">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Picons manager</property>
<attributes>
@@ -1822,6 +1890,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkLabel" id="downloader_label">
<property name="visible" bind-source="downloader_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Picons download tool</property>
<attributes>
@@ -1836,8 +1905,9 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkLabel" id="converter_label">
<property name="visible" bind-source="converter_button" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Converter between name formats</property>
<property name="label" translatable="yes">Converter between formats</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -40,7 +40,7 @@ from app.commons import run_idle, run_task, run_with_delay, log
from app.connections import upload_data, DownloadType, download_data, remove_picons
from app.settings import SettingsType, Settings, SEP, IS_DARWIN
from app.tools.picons import (PiconsParser, parse_providers, Provider, convert_to, download_picon, PiconsCzDownloader,
PiconsError)
PiconsError, PiconFormat)
from app.tools.satellites import SatellitesParser, SatelliteSource
from .dialogs import show_dialog, DialogType, translate, get_builder, get_chooser_dialog
from .main_helper import (scroll_to, on_popup_menu, get_base_model, set_picon, get_picon_pixbuf, get_picon_dialog,
@@ -153,13 +153,9 @@ class PiconManager(Gtk.Box):
self._bouquet_filter_switch = builder.get_object("bouquet_filter_switch")
self._providers_header_box = builder.get_object("providers_header_box")
self._header_download_box = builder.get_object("header_download_box")
self._satellite_label.bind_property("visible", builder.get_object("loading_data_label"), "visible", 4)
self._satellite_label.bind_property("visible", builder.get_object("loading_data_spinner"), "visible", 4)
self._satellite_label.bind_property("visible", self._download_source_button, "sensitive")
self._satellite_label.bind_property("visible", self._satellites_view, "sensitive")
self._cancel_button.bind_property("visible", self._header_download_box, "visible", 4)
self._convert_button.bind_property("visible", self._header_download_box, "visible", 4)
self._download_source_button.bind_property("visible", self._receive_button, "visible")
self._converter_sc_button = builder.get_object("converter_sc_button")
self._converter_nt_button = builder.get_object("converter_nt_button")
self._converter_bq_button = builder.get_object("converter_bq_button")
# Info.
self._dst_count_label = builder.get_object("dst_count_label")
self._info_check_button = builder.get_object("info_check_button")
@@ -169,24 +165,11 @@ class PiconManager(Gtk.Box):
self._filter_bar = builder.get_object("filter_bar")
self._auto_filter_switch = builder.get_object("auto_filter_switch")
self._filter_button = builder.get_object("filter_button")
self._filter_button.bind_property("active", self._filter_bar, "visible")
self._filter_button.bind_property("active", self._src_filter_button, "visible")
self._filter_button.bind_property("active", self._dst_filter_button, "visible")
self._filter_button.bind_property("visible", self._info_check_button, "visible")
self._filter_button.bind_property("visible", self._remove_button, "visible")
self._src_button = builder.get_object("src_button")
self._src_button.bind_property("active", builder.get_object("explorer_dst_label"), "visible")
self._src_button.bind_property("active", builder.get_object("src_picon_box_frame"), "visible")
self._filter_button.bind_property("visible", self._src_button, "visible")
self._info_check_button.bind_property("active", builder.get_object("explorer_info_box_frame"), "visible")
# Header buttons. -> Used instead stack switcher.
self._manager_button = builder.get_object("manager_button")
self._manager_button.bind_property("active", builder.get_object("manager_label"), "visible")
self._downloader_button = builder.get_object("downloader_button")
self._downloader_button.bind_property("active", builder.get_object("downloader_label"), "visible")
self._converter_button = builder.get_object("converter_button")
self._converter_button.bind_property("active", builder.get_object("converter_label"), "visible")
self._manager_button.bind_property("active", builder.get_object("add_menu_button"), "visible")
# Init drag-and-drop
self.init_drag_and_drop()
# Rendering.
@@ -223,6 +206,8 @@ class PiconManager(Gtk.Box):
name = "downloader"
elif is_converter:
name = "converter"
if not self._enigma2_path_button.get_filename():
self._enigma2_path_button.set_filename(self._settings.profile_picons_path)
self._stack.set_visible_child_name(name)
@@ -252,6 +237,7 @@ class PiconManager(Gtk.Box):
def on_profile_changed(self, app, data):
self._current_path_label.set_text(self._settings.profile_picons_path)
self.update_picons_dest(app, self._app.page)
self._enigma2_path_button.set_filename(self._settings.profile_picons_path)
def on_picon_assign(self, app, target):
if target is ViewTarget.SERVICES:
@@ -990,11 +976,10 @@ class PiconManager(Gtk.Box):
return True
def on_tree_view_key_press(self, view, event):
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
if key is KeyboardKey.DELETE:
self.on_local_remove(view)
@@ -1019,9 +1004,25 @@ class PiconManager(Gtk.Box):
return
self._app.change_action_state("on_logs_show", GLib.Variant.new_boolean(True))
convert_to(src_path=picons_path,
dest_path=save_path,
s_type=SettingsType.ENIGMA_2,
ids = None
p_format = PiconFormat.NEUTRINO if self._converter_nt_button.get_active() else PiconFormat.OSCAM
if p_format is PiconFormat.OSCAM:
try:
from PIL import Image
except ImportError as e:
self.show_info_message(f"{translate('Conversion error.')} {e}", Gtk.MessageType.ERROR)
return
if self._converter_bq_button.get_active():
bq_selected = self._app.check_bouquet_selection()
if not bq_selected:
return
services = self._app.current_services
ids = {services.get(s).picon_id for s in self._app.current_bouquets.get(bq_selected) if s in services}
convert_to(src_path=picons_path, dest_path=save_path, p_format=p_format, ids=ids, services=self._services,
done_callback=lambda: self.show_info_message(translate("Done!"), Gtk.MessageType.INFO))
@run_idle

View File

@@ -390,7 +390,7 @@ class PlayerBox(Gtk.Overlay):
width, height = size
if self._playback_window:
self._playback_window.show()
self._playback_window.present()
self._playback_window.set_title(title or self.get_playback_title())
else:
self._playback_window = Gtk.Window(title=title or self.get_playback_title(),

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -143,7 +143,8 @@ class RecordingsTool(Gtk.Box):
if self._ftp:
self._ftp.close()
self._ftp = UtfFTP(host=self._settings.host, user=self._settings.user, passwd=self._settings.password)
host, port = self._settings.host, self._settings.port
self._ftp = UtfFTP(host=host, port=port, user=self._settings.user, passwd=self._settings.password)
self._ftp.encoding = "utf-8"
except all_errors:
pass # NOP
@@ -303,11 +304,10 @@ class RecordingsTool(Gtk.Box):
self._filter_entry.grab_focus() if button.get_active() else self._filter_entry.set_text("")
def on_recordings_key_press(self, view, event):
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
if key is KeyboardKey.DELETE:
self.on_recording_remove()

View File

@@ -3,7 +3,7 @@
The MIT License (MIT)
Copyright (c) 2018-2024 Dmitriy Yefremov
Copyright (c) 2018-2026 Dmitriy Yefremov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@ Author: Dmitriy Yefremov
<!-- interface-license-type mit -->
<!-- interface-name DemonEditor -->
<!-- interface-description Enigma2 channel and satellite list editor for GNU/Linux. -->
<!-- interface-copyright 2018-2024 Dmitriy Yefremov -->
<!-- interface-copyright 2018-2026 Dmitriy Yefremov -->
<!-- interface-authors Dmitriy Yefremov -->
<object class="GtkListStore" id="fec_list_store">
<columns>
@@ -290,7 +290,7 @@ Author: Dmitriy Yefremov
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Save current service</property>
<property name="tooltip_text" translatable="yes">Save current changes</property>
<property name="valign">center</property>
<signal name="clicked" handler="on_save" swapped="no"/>
<accelerator key="Return" signal="activate"/>
@@ -298,12 +298,13 @@ Author: Dmitriy Yefremov
</child>
<child type="action">
<object class="GtkButton" id="create_button">
<property name="label" translatable="yes">Create</property>
<property name="label" translatable="yes">Add</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Create and save as new service</property>
<property name="tooltip_text" translatable="yes">Create a new service</property>
<property name="valign">center</property>
<signal name="clicked" handler="on_create_new" swapped="no"/>
<signal name="clicked" handler="on_save" swapped="no"/>
<accelerator key="Return" signal="activate"/>
</object>
</child>
<child internal-child="vbox">

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -38,10 +38,10 @@ from app.eparser.ecommons import (MODULATION, Inversion, ROLL_OFF, Pilot, Flag,
from app.eparser.neutrino import get_attributes, SP, KSP
from app.settings import SettingsType
from .dialogs import show_dialog, DialogType, Action, get_builder
from .main_helper import get_base_model
from .main_helper import get_base_model, scroll_to
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, HIDE_ICON, CODED_ICON, Column
_UI_PATH = UI_RESOURCES_PATH + "service_details_dialog.glade"
_UI_PATH = f"{UI_RESOURCES_PATH}service_dialog.glade"
class ServiceDetailsDialog:
@@ -62,10 +62,9 @@ class ServiceDetailsDialog:
_DIGIT_ENTRY_NAME = "digit-entry"
def __init__(self, app, new_color, action=Action.EDIT):
def __init__(self, app, action=Action.EDIT, tr_type=TrType.Satellite):
handlers = {"on_system_changed": self.on_system_changed,
"on_save": self.on_save,
"on_create_new": self.on_create_new,
"on_tr_edit_toggled": self.on_tr_edit_toggled,
"update_reference": self.update_reference,
"on_cas_entry_changed": self.on_cas_entry_changed,
@@ -81,7 +80,7 @@ class ServiceDetailsDialog:
self._dialog = builder.get_object("service_details_dialog")
self._dialog.set_transient_for(app.app_window)
self._s_type = settings.setting_type
self._tr_type = TrType.Satellite
self._tr_type = tr_type
self._picons_path = settings.profile_picons_path
self._services_view = app.services_view
self._fav_view = app.fav_view
@@ -89,19 +88,19 @@ class ServiceDetailsDialog:
self._old_service = None
self._services = app.current_services
self._bouquets = app.current_bouquets
self._new_color = new_color
self._new_color = app._NEW_COLOR
self._transponder_services_iters = None
self._current_model = None
self._current_itr = None
# Patterns
# Patterns.
self._DIGIT_PATTERN = re.compile("\\D")
self._NON_EMPTY_PATTERN = re.compile("(?:^[\\s]*$|\\D)")
self._CAID_PATTERN = re.compile("(?:^[\\s]*$)|(C:[0-9a-fA-F]{1,4})(,C:[0-9a-fA-F]{1,4})*")
self._PIDS_PATTERN = re.compile("(?:^[\\s]*$)|(c:[0-9]{2}[0-9a-fA-F]{1,4})(,c:[0-9]{2}[0-9a-fA-F]{1,4})*?")
# Buttons
# Buttons.
self._apply_button = builder.get_object("apply_button")
self._create_button = builder.get_object("create_button")
# style
# Style.
self._style_provider = Gtk.CssProvider()
self._style_provider.load_from_path(UI_RESOURCES_PATH + "style.css")
# initialization only digit elements
@@ -175,21 +174,53 @@ class ServiceDetailsDialog:
def show(self):
self._dialog.show()
@run_idle
def init_default_data_elements(self):
srv_data = [None] * 20
srv_data[Column.SRV_CAS_FLAGS] = "f:40"
srv_data[Column.SRV_SERVICE] = "New"
srv_data[Column.SRV_PACKAGE] = "New"
srv_data[Column.SRV_SSID] = "0"
srv_data[Column.SRV_PICON_ID] = "1_0_1_0_0_0_000000_0_0_0.png"
srv_data[Column.SRV_FAV_ID] = "1:0:1:0:0:0:000000:0:0:0::0:0:0:0"
if self._tr_type is TrType.Cable:
srv_data[Column.SRV_STANDARD] = "c"
srv_data[Column.SRV_FREQ] = "300"
srv_data[Column.SRV_RATE] = "6000"
srv_data[Column.SRV_SYSTEM] = "DVB-C"
srv_data[Column.SRV_POS] = "C"
srv_data[Column.SRV_DATA_ID] = "0000:00000000:0:0:1:0"
srv_data[Column.SRV_TRANSPONDER] = "t 300000000:0:0:0:0:0:0:0:0:0:0:0"
elif self._tr_type is TrType.Terrestrial:
srv_data[Column.SRV_STANDARD] = "t"
srv_data[Column.SRV_FREQ] = "420000"
srv_data[Column.SRV_RATE] = "0"
srv_data[Column.SRV_SYSTEM] = "DVB-T2"
srv_data[Column.SRV_POS] = "T"
srv_data[Column.SRV_DATA_ID] = "0000:00000000:0:0:1:0"
srv_data[Column.SRV_TRANSPONDER] = "t 420000000:0:5:5:3:2:4:4:2:1:0:0"
else:
srv_data[Column.SRV_STANDARD] = "s"
srv_data[Column.SRV_FREQ] = "10720"
srv_data[Column.SRV_RATE] = "27500"
srv_data[Column.SRV_POL] = "H"
srv_data[Column.SRV_FEC] = "Auto"
srv_data[Column.SRV_SYSTEM] = "DVB-S"
srv_data[Column.SRV_POS] = "0.0E"
srv_data[Column.SRV_DATA_ID] = "0:00000000:0:0000:1:0:0:0:0:0"
srv_data[Column.SRV_TRANSPONDER] = "s 10720000:27500000:0:1:0:0:0:0:0"
srv = Service(*srv_data)
self._old_service = srv
self._apply_button.set_visible(False)
self._create_button.set_visible(True)
self._tr_edit_switch.set_sensitive(False)
self.on_tr_edit_toggled(self._tr_edit_switch.set_active(True), True)
for elem in self._non_empty_elements.values():
elem.set_text(" ")
elem.set_text("")
self._new_check_button.set_active(True)
self._service_type_combo_box.set_active(0)
self._pol_combo_box.set_active(0)
self._fec_combo_box.set_active(0)
self._sys_combo_box.set_active(0)
self._invertion_combo_box.set_active(2)
self.init_service_data(srv)
self._current_model = get_base_model(self._services_view.get_model())
def update_data_elements(self):
model, paths = self._services_view.get_selection().get_selected_rows()
@@ -215,6 +246,9 @@ class ServiceDetailsDialog:
srv = Service(*self._current_model[itr][: Column.SRV_TOOLTIP])
self._old_service = srv
self._current_itr = itr
self.init_service_data(srv)
def init_service_data(self, srv):
# Service
self._name_entry.set_text(srv.service)
self._package_entry.set_text(srv.package)
@@ -226,6 +260,15 @@ class ServiceDetailsDialog:
self.select_active_text(self._pol_combo_box, srv.pol)
self.select_active_text(self._fec_combo_box, srv.fec)
self.select_active_text(self._sys_combo_box, srv.system)
self.update_ui(srv)
if self._s_type is SettingsType.ENIGMA_2:
self.init_enigma2_service_data(srv)
self.init_enigma2_transponder_data(srv)
elif self._s_type is SettingsType.NEUTRINO_MP:
self.init_neutrino_data(srv)
self.init_neutrino_ui_elements()
def update_ui(self, srv):
if self._tr_type is TrType.Terrestrial:
self.update_ui_for_terrestrial()
elif self._tr_type is TrType.Cable:
@@ -235,13 +278,6 @@ class ServiceDetailsDialog:
else:
self.set_sat_positions(srv.pos)
if self._s_type is SettingsType.ENIGMA_2:
self.init_enigma2_service_data(srv)
self.init_enigma2_transponder_data(srv)
elif self._s_type is SettingsType.NEUTRINO_MP:
self.init_neutrino_data(srv)
self.init_neutrino_ui_elements()
# ***************** Init Enigma2 data *********************#
@run_idle
@@ -316,7 +352,7 @@ class ServiceDetailsDialog:
self.select_active_text(self._mod_combo_box, MODULATION.get(tr_data[8]))
self.select_active_text(self._rolloff_combo_box, ROLL_OFF.get(tr_data[9]))
self.select_active_text(self._pilot_combo_box, Pilot(tr_data[10]).name)
self._tr_flag_entry.set_text(tr_data[7])
self._tr_flag_entry.set_text(tr_data[6])
if data_len > 12:
self._stream_id_entry.set_text(tr_data[11])
self._pls_code_entry.set_text(tr_data[12])
@@ -375,6 +411,12 @@ class ServiceDetailsDialog:
""" Sat positions initialisation """
self._sat_pos_button.set_value(float(sat_pos[:-1]))
self._pos_side_box.set_active_id(sat_pos[-1:])
self._sat_pos_button.connect("value-changed", self.on_sat_value_changed)
def on_sat_value_changed(self, button):
pos = int(self.get_sat_position())
namespace = int(f"{3600 - abs(pos) if pos < 0 else pos:04x}0000", 16)
self._namespace_entry.set_text(str(namespace))
def on_system_changed(self, box):
if not self._tr_edit_switch.get_active():
@@ -403,11 +445,8 @@ class ServiceDetailsDialog:
def on_save(self, item):
self.save_data()
def on_create_new(self, item):
self.save_data()
def save_data(self):
if self._s_type is SettingsType.NEUTRINO_MP and self._tr_type is not TrType.Satellite:
if self._s_type is SettingsType.NEUTRINO_MP:
show_dialog(DialogType.ERROR, transient=self._dialog, text="Not implemented yet!")
return
@@ -423,12 +462,25 @@ class ServiceDetailsDialog:
def on_new(self):
""" Create new service. """
service = self.get_service(*self.get_srv_data(), self.get_satellite_transponder_data())
show_dialog(DialogType.ERROR, transient=self._dialog, text="Not implemented yet!")
srv_data = self.update_service_data()
if not srv_data:
return False
service, data = srv_data
itr = self._current_model.append(service + (None, data.get(Column.SRV_BACKGROUND, None)))
scroll_to(self._current_model.get_path(itr), self._services_view)
return True
def on_edit(self):
""" Edit current service. """
service, extra_data = self.update_service_data()
self._current_model.set(self._current_itr, extra_data)
self._current_model.set(self._current_itr, {i: v for i, v in enumerate(service)})
self.update_fav_view(self._old_service, service)
return True
def update_service_data(self):
fav_id, data_id = self.get_srv_data()
# Transponder
transponder = self._old_service.transponder
@@ -443,8 +495,9 @@ class ServiceDetailsDialog:
elif self._tr_type is TrType.ATSC:
transponder = self.get_atsc_transponder_data()
except Exception as e:
log("Edit service error: {}".format(e))
log(f"Edit service error: {e}")
show_dialog(DialogType.ERROR, transient=self._dialog, text="Error getting transponder parameters!")
return False
else:
if self._transponder_services_iters:
self.update_transponder_services(transponder, self.get_sat_position())
@@ -470,11 +523,9 @@ class ServiceDetailsDialog:
if f_flags and Flag.is_new(Flag.parse(f_flags[0])):
extra_data[Column.SRV_BACKGROUND] = self._new_color
self._current_model.set(self._current_itr, extra_data)
self._current_model.set(self._current_itr, {i: v for i, v in enumerate(service)})
self.update_fav_view(self._old_service, service)
self._old_service = service
return True
return service, extra_data
def update_bouquets(self, fav_id, old_fav_id):
self._services.pop(old_fav_id, None)
@@ -633,14 +684,13 @@ class ServiceDetailsDialog:
sat_pos = self.get_sat_position()
inv = get_value_by_name(Inversion, self._invertion_combo_box.get_active_id())
srv_sys = "0" # !!!
flag = self._tr_flag_entry.get_text() or "0"
if self._s_type is SettingsType.ENIGMA_2:
dvb_s_tr = self._ENIGMA2_TRANSPONDER_DATA.format("s", freq, rate, pol, fec, sat_pos, inv, srv_sys)
dvb_s_tr = self._ENIGMA2_TRANSPONDER_DATA.format("s", freq, rate, pol, fec, sat_pos, inv, flag)
if sys == "DVB-S":
return dvb_s_tr
if sys == "DVB-S2":
flag = self._tr_flag_entry.get_text()
mod = self.get_value_from_combobox_id(self._mod_combo_box, MODULATION)
roll_off = self.get_value_from_combobox_id(self._rolloff_combo_box, ROLL_OFF)
pilot = get_value_by_name(Pilot, self._pilot_combo_box.get_active_id())
@@ -649,7 +699,7 @@ class ServiceDetailsDialog:
st_id = self._stream_id_entry.get_text()
pls = f":{st_id}:{pls_code}:{pls_mode}" if pls_mode and pls_code and st_id else ""
return f"{dvb_s_tr}:{flag}:{mod}:{roll_off}:{pilot}{pls}"
return f"{dvb_s_tr}:1:{mod}:{roll_off}:{pilot}{pls}"
elif self._s_type is SettingsType.NEUTRINO_MP:
tr_data = get_attributes(self._old_service.transponder)

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2
Copyright (C) 2018-2023 Dmitriy Yefremov
Copyright (C) 2018-2025 Dmitriy Yefremov
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@@ -17,7 +17,7 @@ Author: Dmitriy Yefremov
<!-- interface-license-type all_permissive -->
<!-- interface-name DemonEditor -->
<!-- interface-description Enigma2 channel and satellites list editor. -->
<!-- interface-copyright 2018-2023 Dmitriy Yefremov -->
<!-- interface-copyright 2018-2025 Dmitriy Yefremov -->
<!-- interface-authors Dmitriy Yefremov -->
<object class="GtkAdjustment" id="font_size_adjustment">
<property name="lower">8</property>
@@ -839,6 +839,7 @@ Author: Dmitriy Yefremov
<property name="max-width-chars">6</property>
<property name="text">21</property>
<property name="primary-icon-name">network-workgroup-symbolic</property>
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
@@ -861,6 +862,7 @@ Author: Dmitriy Yefremov
<property name="max-width-chars">6</property>
<property name="text" translatable="yes">80</property>
<property name="primary-icon-name">network-workgroup-symbolic</property>
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -906,6 +908,7 @@ Author: Dmitriy Yefremov
<property name="max-width-chars">6</property>
<property name="text" translatable="yes">23</property>
<property name="primary-icon-name">network-workgroup-symbolic</property>
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -2415,6 +2418,7 @@ Author: Dmitriy Yefremov
<item id="nl_NL">Nederlands</item>
<item id="pl_PL">Polski</item>
<item id="pt_PT">Português</item>
<item id="sk_SK">Slovák</item>
<item id="tr_TR">Türkçe</item>
<item id="be_BY">Беларуская</item>
<item id="ru_RU">Русский</item>
@@ -3948,6 +3952,46 @@ Author: Dmitriy Yefremov
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox" id="enable_epg_name_cache_box">
<property name="visible">True</property>
<property name="sensitive" bind-source="enable_experimental_switch" bind-property="active">False</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Enables additional cache to display EPG for some IPTV channels imported from *.m3u.</property>
<child>
<object class="GtkLabel" id="enable_epg_name_cache_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Enable additional name cache for EPG</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="enable_epg_name_cache_switch">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">end</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
</object>
</child>
<style>

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -185,6 +185,7 @@ class SettingsDialog:
self._enable_yt_dl_switch = builder.get_object("enable_yt_dl_switch")
self._enable_update_yt_dl_switch = builder.get_object("enable_update_yt_dl_switch")
self._enable_send_to_switch = builder.get_object("enable_send_to_switch")
self._enable_epg_name_cache_switch = builder.get_object("enable_epg_name_cache_switch")
self._enable_exp_switch = builder.get_object("enable_experimental_switch")
# Profiles.
self._profile_view = builder.get_object("profile_tree_view")
@@ -268,7 +269,13 @@ class SettingsDialog:
def on_response(self, dialog, resp):
if resp == Gtk.ResponseType.ACCEPT:
self._updated = self.on_save_settings()
dialog.destroy()
if not self._updated:
return True
if resp == Gtk.ResponseType.DELETE_EVENT or resp == Gtk.ResponseType.ACCEPT:
dialog.destroy()
return False
def on_field_button_press(self, entry):
update_entry_data(entry, self._dialog, self._settings)
@@ -290,12 +297,12 @@ class SettingsDialog:
self._hosts_box.remove_all()
self._remove_host_button.set_sensitive(len([self._hosts_box.append(h, h) for h in self._settings.hosts]) > 1)
self._hosts_box.set_active_id(self._settings.host)
self._port_field.set_text(self._settings.port)
self._port_field.set_text(str(self._settings.port))
self._login_field.set_text(self._settings.user)
self._password_field.set_text(self._settings.password)
self._http_port_field.set_text(self._settings.http_port)
self._http_port_field.set_text(str(self._settings.http_port))
self._http_use_ssl_check_button.set_active(self._settings.http_use_ssl)
self._telnet_port_field.set_text(self._settings.telnet_port)
self._telnet_port_field.set_text(str(self._settings.telnet_port))
self._telnet_timeout_spin_button.set_value(self._settings.telnet_timeout)
self._services_field.set_text(self._settings.services_path)
self._user_bouquet_field.set_text(self._settings.user_bouquet_path)
@@ -338,6 +345,7 @@ class SettingsDialog:
self._enable_yt_dl_switch.set_active(self._settings.enable_yt_dl)
self._enable_update_yt_dl_switch.set_active(self._settings.enable_yt_dl_update)
self._enable_send_to_switch.set_active(self._settings.enable_send_to)
self._enable_epg_name_cache_switch.set_active(self._settings.enable_epg_name_cache)
self._set_color_switch.set_active(self._settings.use_colors)
new_rgb = Gdk.RGBA()
new_rgb.parse(self._settings.new_color)
@@ -351,29 +359,34 @@ class SettingsDialog:
def on_apply_profile_settings(self, item=None):
if not self.is_data_correct(self._digit_elems):
show_dialog(DialogType.ERROR, self._dialog, "Error. Verify the data!")
return
return False
self._s_type = SettingsType(int(self._settings_type_box.get_active_id()))
self._settings.setting_type = self._s_type
self._settings.host = self._host_field.get_text()
self._settings.hosts = [h[1] for h in self._hosts_box.get_model()]
self._settings.port = self._port_field.get_text()
self._settings.port = int(self._port_field.get_text())
self._settings.user = self._login_field.get_text()
self._settings.password = self._password_field.get_text()
self._settings.http_port = self._http_port_field.get_text()
self._settings.http_port = int(self._http_port_field.get_text())
self._settings.http_use_ssl = self._http_use_ssl_check_button.get_active()
self._settings.telnet_port = self._telnet_port_field.get_text()
self._settings.telnet_port = int(self._telnet_port_field.get_text())
self._settings.telnet_timeout = int(self._telnet_timeout_spin_button.get_value())
self._settings.services_path = self._services_field.get_text()
self._settings.satellites_xml_path = self._satellites_xml_field.get_text()
self._settings.user_bouquet_path = self._user_bouquet_field.get_text()
self._settings.epg_dat_path = self._epg_dat_box.get_active_id()
self._settings.picons_path = self._picons_paths_box.get_active_id()
return True
def on_save_settings(self, item=None):
if show_dialog(DialogType.QUESTION, self._dialog) != Gtk.ResponseType.OK:
return False
self.on_apply_profile_settings()
if not self.on_apply_profile_settings():
return False
self._ext_settings.profiles = self._settings.profiles
self._ext_settings.backup_before_save = self._before_save_switch.get_active()
self._ext_settings.backup_before_downloading = self._before_downloading_switch.get_active()
@@ -420,6 +433,7 @@ class SettingsDialog:
self._ext_settings.enable_yt_dl = self._enable_yt_dl_switch.get_active()
self._ext_settings.enable_yt_dl_update = self._enable_update_yt_dl_switch.get_active()
self._ext_settings.enable_send_to = self._enable_send_to_switch.get_active()
self._ext_settings.enable_epg_name_cache = self._enable_epg_name_cache_switch.get_active()
self._ext_settings.default_profile = list(filter(lambda r: r[1], self._profile_view.get_model()))[0][0]
self._ext_settings.save()
@@ -430,6 +444,11 @@ class SettingsDialog:
def on_connection_test(self, item):
if self._test_spinner.get_state() is Gtk.StateType.ACTIVE:
return
if not self.is_data_correct((self._port_field, self._http_port_field, self._telnet_port_field)):
show_dialog(DialogType.ERROR, self._dialog, "Error. Verify the data!")
return
self.show_spinner(True)
if self._ftp_radio_button.get_active():
self.test_ftp()
@@ -440,7 +459,7 @@ class SettingsDialog:
def test_http(self):
user, password = self._login_field.get_text(), self._password_field.get_text()
host, port = self._host_field.get_text(), self._http_port_field.get_text()
host, port = self._host_field.get_text(), int(self._http_port_field.get_text())
use_ssl = self._http_use_ssl_check_button.get_active()
try:
self.show_info_message(test_http(host, port, user, password, use_ssl=use_ssl, s_type=self._s_type),
@@ -454,7 +473,7 @@ class SettingsDialog:
def test_telnet(self):
timeout = int(self._telnet_timeout_spin_button.get_value())
host, port = self._host_field.get_text(), self._telnet_port_field.get_text()
host, port = self._host_field.get_text(), int(self._telnet_port_field.get_text())
user, password = self._login_field.get_text(), self._password_field.get_text()
try:
self.show_info_message(test_telnet(host, port, user, password, timeout), Gtk.MessageType.INFO)
@@ -464,7 +483,7 @@ class SettingsDialog:
self.show_spinner(False)
def test_ftp(self):
host, port = self._host_field.get_text(), self._port_field.get_text()
host, port = self._host_field.get_text(), int(self._port_field.get_text())
user, password = self._login_field.get_text(), self._password_field.get_text()
try:
self.show_info_message(f"OK. {test_ftp(host, port, user, password)}", Gtk.MessageType.INFO)
@@ -497,6 +516,7 @@ class SettingsDialog:
self._support_ver5_switch.set_active(state)
self._unlimited_buffer_switch.set_active(state)
self._enable_send_to_switch.set_active(state)
self._enable_epg_name_cache_switch.set_active(state)
self._enable_yt_dl_switch.set_active(state)
def on_force_bq_name(self, switch, state):
@@ -672,7 +692,7 @@ class SettingsDialog:
if mode is PlaybackMode.PLAY:
self.show_info_message("Operates in standby mode or current active transponder!", Gtk.MessageType.WARNING)
elif mode is PlaybackMode.STREAM:
self.show_info_message("Playback IPTV streams only!", Gtk.MessageType.WARNING)
self.show_info_message("Playback of IPTV streams only!", Gtk.MessageType.WARNING)
elif mode is PlaybackMode.DISABLED:
self._allow_main_list_playback_switch.set_active(False)
else:

View File

@@ -49,6 +49,10 @@ paned.vertical > separator {
background-size: 24px 2px;
}
progressbar > trough {
min-width: 75px;
}
.red-button {
background-image: none;
background-color: red;

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2022 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -24,6 +24,8 @@
#
# Author: Dmitriy Yefremov
#
from app.ui.dialogs import translate
from .uicommons import Gtk, GLib
@@ -52,14 +54,13 @@ class BGTaskWidget(Gtk.Box):
self.pack_start(close_button, False, False, 0)
self.show_all()
# Just prototype. -> It may not work properly!
# TODO: Different options need to be tested. Possibly with normal threads.
from concurrent.futures import ThreadPoolExecutor
from gi.repository.Gio import Task, Cancellable
self._executor = ThreadPoolExecutor(max_workers=self.TASK_LIMIT)
future = self._executor.submit(target, *args)
future.add_done_callback(lambda f: GLib.idle_add(self._app.emit, "task-done", self))
self._task = Task.new(self, Cancellable.new(), lambda s, t: GLib.idle_add(self._app.emit, "task-done", self))
self._task.set_priority(GLib.PRIORITY_LOW)
self._task.set_return_on_cancel(True)
self._task.run_in_thread(lambda t, s, d, c: target(*args))
@property
def text(self):
@@ -78,7 +79,10 @@ class BGTaskWidget(Gtk.Box):
self.set_tooltip_text(value)
def cancel(self):
self._executor.shutdown(wait=False)
cancelable = self._task.get_cancellable()
if cancelable:
cancelable.cancel()
self._app.emit("task-canceled", None)

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -27,43 +27,16 @@
import re
import selectors
import socket
from collections import deque
from telnetlib import Telnet
from gi.repository import GLib
from app.commons import run_task, run_idle, log
from app.connections import ExtTelnet
from app.ui.uicommons import Gtk, Gdk, UI_RESOURCES_PATH, KeyboardKey, MOD_MASK
class ExtTelnet(Telnet):
def __init__(self, output_callback, **kwargs):
super().__init__(**kwargs)
self._output_callback = output_callback
def interact(self):
""" Interaction function, emulates a very dumb telnet client. """
with selectors.DefaultSelector() as selector:
selector.register(self, selectors.EVENT_READ)
while True:
for key, events in selector.select():
if key.fileobj is self:
try:
text = self.read_very_eager()
except EOFError as e:
msg = "\n*** Connection closed by remote host ***\n"
self._output_callback(msg)
log(msg)
raise e
else:
if text:
self._output_callback(text)
class TelnetClient(Gtk.Box):
""" Very simple telnet client. """
_COLOR_PATTERN = re.compile("\x1b.*?m") # Color info
@@ -156,11 +129,10 @@ class TelnetClient(Gtk.Box):
self.do_command()
return True
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
return
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return False
key = KeyboardKey(key_code)
ctrl = event.state & MOD_MASK
if ctrl and key is KeyboardKey.C:
if self._tn and self._tn.sock:
@@ -181,6 +153,7 @@ class TelnetClient(Gtk.Box):
self._commands.append(cmd)
self._buf.insert_at_cursor(cmd, -1)
return True
return False
def delete_last_command(self):
end = self._buf.get_end_iter()

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -460,11 +460,10 @@ class TimerTool(Gtk.Box):
on_popup_menu(menu, event)
def on_timers_key_release(self, view, event):
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
ctrl = event.state & MOD_MASK
if key is KeyboardKey.DELETE:

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2023 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -143,7 +143,7 @@ def get_yt_icon(icon_name, size=24):
if n_theme.has_icon(icon_name):
return n_theme.load_icon(icon_name, size, 0)
return default_theme.load_icon("emblem-important-symbolic", size, 0)
return get_icon("emblem-important-symbolic", size, LINK_ICON)
def show_notification(message, timeout=10000, urgency=1):
@@ -194,6 +194,7 @@ class ViewTarget(Enum):
FAV = 1
SERVICES = 2
IPTV = 3
ALT = 4
class BqGenType(Enum):
@@ -289,14 +290,8 @@ class Column(IntEnum):
# *************** Keyboard keys *************** #
class BaseKeyboardKey(Enum):
@classmethod
def value_exist(cls, value):
return value in (val.value for val in cls.__members__.values())
if IS_LINUX:
class KeyboardKey(BaseKeyboardKey):
class KeyboardKey(IntEnum):
""" The raw(hardware) codes [Linux] of the keyboard keys. """
E = 26
R = 27
@@ -334,8 +329,14 @@ if IS_LINUX:
PAGE_UP_KP = 81
PAGE_DOWN_KP = 89
UNDEFINED = -1
@classmethod
def _missing_(cls, value):
return cls.UNDEFINED
elif IS_DARWIN:
class KeyboardKey(BaseKeyboardKey):
class KeyboardKey(IntEnum):
""" The raw(hardware) codes [macOS] of the keyboard keys. """
F = 3
E = 14
@@ -375,8 +376,14 @@ elif IS_DARWIN:
PAGE_UP_KP = -1
PAGE_DOWN_KP = -1
UNDEFINED = -1
@classmethod
def _missing_(cls, value):
return cls.UNDEFINED
else:
class KeyboardKey(BaseKeyboardKey):
class KeyboardKey(IntEnum):
""" The raw(hardware) codes [Windows] of the keyboard keys. """
E = 69
R = 82
@@ -414,6 +421,12 @@ else:
PAGE_UP_KP = -1
PAGE_DOWN_KP = -1
UNDEFINED = -1
@classmethod
def _missing_(cls, value):
return cls.UNDEFINED
# Keys for move in lists. KEY_KP_(NAME) for laptop!
MOVE_KEYS = {KeyboardKey.UP, KeyboardKey.PAGE_UP,
KeyboardKey.DOWN, KeyboardKey.PAGE_DOWN,
@@ -421,5 +434,27 @@ MOVE_KEYS = {KeyboardKey.UP, KeyboardKey.PAGE_UP,
KeyboardKey.HOME_KP, KeyboardKey.END_KP,
KeyboardKey.PAGE_UP_KP, KeyboardKey.PAGE_DOWN_KP}
class LoadingProgressBar(Gtk.ProgressBar):
""" A custom class for a progress bar.
Used as an alternative to Gtk.Spinner to reduce CPU load.
"""
__gtype_name__ = "LoadingProgressBar"
def __init__(self, **properties):
super().__init__(**properties)
self.connect("notify::visible", self.on_visible)
def on_visible(self, bar, param):
if self.get_visible():
GLib.timeout_add(500, self.update, priority=GLib.PRIORITY_LOW)
def update(self):
self.pulse()
return self.get_visible()
if __name__ == "__main__":
pass

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2
<!-- Generated with glade 3.40.0
The MIT License (MIT)
Copyright (c) 2018-2024 Dmitriy Yefremov
Copyright (c) 2018-2025 Dmitriy Yefremov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,7 @@ Author: Dmitriy Yefremov
<!-- interface-css-provider-path style.css -->
<!-- interface-license-type mit -->
<!-- interface-name DemonEditor -->
<!-- interface-copyright 2018-2024 Dmitriy Yefremov -->
<!-- interface-copyright 2018-2025 Dmitriy Yefremov -->
<!-- interface-authors Dmitriy Yefremov -->
<!-- n-columns=2 n-rows=4 -->
<object class="GtkGrid" id="cable_tr_box">
@@ -879,7 +879,7 @@ Author: Dmitriy Yefremov
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=4 -->
<!-- n-columns=2 n-rows=5 -->
<object class="GtkGrid" id="tr_dialog_grid2">
<property name="visible">True</property>
<property name="can-focus">False</property>
@@ -911,7 +911,7 @@ Author: Dmitriy Yefremov
<property name="max-width-chars">12</property>
<property name="primary-icon-name">document-edit-symbolic</property>
<property name="primary-icon-activatable">False</property>
<property name="placeholder-text" translatable="yes">0 - 262142</property>
<property name="placeholder-text">0 - 262142</property>
<property name="input-purpose">digits</property>
<signal name="changed" handler="on_entry_changed" swapped="no"/>
</object>
@@ -928,7 +928,7 @@ Author: Dmitriy Yefremov
<property name="max-width-chars">12</property>
<property name="primary-icon-name">document-edit-symbolic</property>
<property name="primary-icon-activatable">False</property>
<property name="placeholder-text" translatable="yes">0 - 255</property>
<property name="placeholder-text">0 - 255</property>
<property name="input-purpose">digits</property>
<signal name="changed" handler="on_entry_changed" swapped="no"/>
</object>
@@ -945,7 +945,7 @@ Author: Dmitriy Yefremov
<property name="max-width-chars">12</property>
<property name="primary-icon-name">document-edit-symbolic</property>
<property name="primary-icon-activatable">False</property>
<property name="placeholder-text" translatable="yes">0 - 255</property>
<property name="placeholder-text">0 - 255</property>
<property name="input-purpose">digits</property>
<signal name="changed" handler="on_entry_changed" swapped="no"/>
</object>
@@ -1095,6 +1095,58 @@ Author: Dmitriy Yefremov
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="tr_t2mi_pid_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">T2-MI PID</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label">:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="t2mi_pid_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="width-chars">5</property>
<property name="max-width-chars">12</property>
<property name="primary-icon-name">document-edit-symbolic</property>
<property name="primary-icon-activatable">False</property>
<property name="placeholder-text">0 - 8191</property>
<property name="input-purpose">digits</property>
<signal name="changed" handler="on_entry_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2025 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -207,6 +207,7 @@ class SatTransponderDialog(TransponderDialog):
self._pls_code_entry = builder.get_object("pls_code_entry")
self._is_id_entry = builder.get_object("is_id_entry")
self._t2mi_plp_id_entry = builder.get_object("t2mi_plp_id_entry")
self._t2mi_pid_entry = builder.get_object("t2mi_pid_entry")
self.set_style_provider(self._freq_entry)
self.set_style_provider(self._rate_entry)
@@ -230,6 +231,7 @@ class SatTransponderDialog(TransponderDialog):
self._is_id_entry.set_text(transponder.is_id if transponder.is_id else "")
self._pls_code_entry.set_text(transponder.pls_code if transponder.pls_code else "")
self._t2mi_plp_id_entry.set_text(transponder.t2mi_plp_id if transponder.t2mi_plp_id else "")
self._t2mi_pid_entry.set_text(transponder.t2mi_pid if transponder.t2mi_pid else "")
def to_transponder(self):
return Transponder(frequency=self._freq_entry.get_text(),
@@ -241,7 +243,8 @@ class SatTransponderDialog(TransponderDialog):
pls_mode=get_key_by_value(PLS_MODE, self._pls_mode_box.get_active_id()),
pls_code=self._pls_code_entry.get_text(),
is_id=self._is_id_entry.get_text(),
t2mi_plp_id=self._t2mi_plp_id_entry.get_text())
t2mi_plp_id=self._t2mi_plp_id_entry.get_text(),
t2mi_pid=self._t2mi_pid_entry.get_text())
def is_accept(self):
tr = self.to_transponder()
@@ -255,6 +258,8 @@ class SatTransponderDialog(TransponderDialog):
return False
elif self.digit_pattern.search(tr.t2mi_plp_id):
return False
elif self.digit_pattern.search(tr.t2mi_pid):
return False
return True

View File

@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2024 Dmitriy Yefremov
# Copyright (c) 2018-2026 Dmitriy Yefremov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -239,12 +239,6 @@ class SatellitesTool(Gtk.Box):
self._transponders_stack.set_visible_child_name(self._dvb_type)
self._update_header_button.set_sensitive(self._dvb_type is self.DVB.SAT)
if self._dvb_type is self.DVB.SAT:
self._app.on_info_bar_close()
else:
self._app.show_info_message("EXPERIMENTAL!", Gtk.MessageType.WARNING)
def on_satellite_selection(self, view):
model = self._sat_tr_view.get_model()
model.clear()
@@ -310,11 +304,10 @@ class SatellitesTool(Gtk.Box):
def on_key_press(self, view, event):
""" Handling keystrokes. """
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
ctrl = event.state & MOD_MASK
if key is KeyboardKey.DELETE:
@@ -329,12 +322,11 @@ class SatellitesTool(Gtk.Box):
view.do_unselect_all(view)
def on_tr_key_press(self, view, event):
""" Handling transponder view keystrokes. """
key_code = event.hardware_keycode
if not KeyboardKey.value_exist(key_code):
""" Handling transponder view keystrokes. """
key = KeyboardKey(event.hardware_keycode)
if key is KeyboardKey.UNDEFINED:
return
key = KeyboardKey(key_code)
ctrl = event.state & MOD_MASK
if key is KeyboardKey.DELETE:
@@ -580,11 +572,11 @@ class SatellitesTool(Gtk.Box):
def on_download(self, app, page):
if page is Page.SATELLITE:
self._app.on_download_data(DownloadType.SATELLITES)
self._app.on_download_data(DownloadType.SATELLITES, files_filter=(f"{self._dvb_type}.xml",))
def on_upload(self, app, page):
if page is Page.SATELLITE:
self._app.upload_data(DownloadType.SATELLITES)
self._app.upload_data(DownloadType.SATELLITES, files_filter=(f"{self._dvb_type}.xml",))
@run_idle
def on_update(self, item=None):

View File

@@ -3,7 +3,7 @@
The MIT License (MIT)
Copyright (c) 2018-2023 Dmitriy Yefremov
Copyright (c) 2018-2025 Dmitriy Yefremov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -128,6 +128,8 @@ Author: Dmitriy Yefremov
<column type="gchararray"/>
<!-- column-name t2mi_plp_id -->
<column type="gchararray"/>
<!-- column-name t2mi_pid -->
<column type="gchararray"/>
</columns>
<signal name="row-deleted" handler="on_sat_tr_model_changed" swapped="no"/>
<signal name="row-inserted" handler="on_sat_tr_model_changed" swapped="no"/>
@@ -424,7 +426,9 @@ Author: Dmitriy Yefremov
<signal name="key-press-event" handler="on_key_press" swapped="no"/>
<signal name="realize" handler="on_terrestrial_view_realize" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
<object class="GtkTreeSelection">
<property name="mode">multiple</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="ter_name_column">
@@ -522,7 +526,9 @@ Author: Dmitriy Yefremov
<signal name="key-press-event" handler="on_key_press" swapped="no"/>
<signal name="realize" handler="on_cable_view_realize" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
<object class="GtkTreeSelection">
<property name="mode">multiple</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="cable_name_column">
@@ -947,7 +953,9 @@ Author: Dmitriy Yefremov
<signal name="button-press-event" handler="on_tr_button_press" object="transponder_popup_menu" swapped="no"/>
<signal name="key-press-event" handler="on_tr_key_press" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
<object class="GtkTreeSelection">
<property name="mode">multiple</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="ter_freq_column">
@@ -1188,7 +1196,9 @@ Author: Dmitriy Yefremov
<signal name="button-press-event" handler="on_tr_button_press" object="transponder_popup_menu" swapped="no"/>
<signal name="key-press-event" handler="on_tr_key_press" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
<object class="GtkTreeSelection">
<property name="mode">multiple</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="cable_freq_column">

View File

@@ -5,8 +5,8 @@ The best way to run this program from source is using of [MSYS2](https://www.msy
![mingw64](https://user-images.githubusercontent.com/7511379/161400639-898ceb10-7de8-4557-bde1-25fe32bdfb03.png)
3. Run first `pacman -Suy` After that, you may need to restart the terminal and re-run the update command.
4. Install minimal required packages:
`pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-requests`
Optional: `pacman -S mingw-w64-x86_64-python3-pillow`
`pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-python-requests`
Optional: `pacman -S mingw-w64-x86_64-python-pillow mingw-w64-x86_64-python-chardet`
To support streams playback, install the following packages (the list may not be complete):
* For [GStreamer](https://gstreamer.freedesktop.org/) `pacman -S mingw-w64-x86_64-gst-libav mingw-w64-x86_64-gst-plugins-bad mingw-w64-x86_64-gst-plugins-base mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gstreamer`
* For [MPV](https://mpv.io/) `pacman -S mingw-w64-x86_64-mpv`,
@@ -23,7 +23,7 @@ And run: `./start.py`
## Building a package
To build a standalone package, we can use [PyInstaller](https://pyinstaller.readthedocs.io/en/stable/).
1. Launch mingw64 shell.
2. Install PyInstaller via pip: `pip3 install pyinstaller`
2. Install PyInstaller: `pacman -S mingw-w64-x86_64-pyinstaller`
3. Go to the folder where the program was unpacked. E.g: `c:\msys64\home\username\DemonEditor\`
4. Сopy and replace the files from the /build/win/ folder to the root .
5. Go to the folder with the program in the running terminal: `cd DemonEditor/`

View File

@@ -1,5 +1,5 @@
#!/bin/bash
VER="3.11.3_Beta"
VER="3.14.4_Beta"
B_PATH="dist/DemonEditor"
DEB_PATH="$B_PATH/usr/share/demoneditor"

View File

@@ -1,5 +1,5 @@
Package: demon-editor
Version: 3.11.3-Beta
Version: 3.14.4-Beta
Section: utils
Priority: optional
Architecture: all

View File

@@ -5,7 +5,7 @@ Source: https://github.com/DYefremov/DemonEditor
Files: *
MIT License
Copyright (c) 2018-2024 Dmitriy Yefremov
Copyright (c) 2018-2026 Dmitriy Yefremov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -32,13 +32,13 @@ a = Analysis([EXE_NAME],
pathex=PATH_EXE,
binaries=None,
datas=ui_files,
hiddenimports=['fileinput', 'uuid', 'asyncio'],
hiddenimports=['fileinput', 'uuid', 'asyncio', 'getpass'],
hookspath=[],
runtime_hooks=[],
hooksconfig={
"gi": {
"languages": ["en", "be", "es", "it", "nl",
"pl", "pt", "ru", "tr", "zh_CN"],
"languages": ["en", "be", "es", "it", "nl", "pl",
"pt", "ru", "sk", "tr", "zh_CN"],
"module-versions": {
"Gtk": "3.0"
},
@@ -81,8 +81,8 @@ app = BUNDLE(coll,
'CFBundleGetInfoString': "Enigma2 channel and satellite editor",
'LSApplicationCategoryType': 'public.app-category.utilities',
'LSMinimumSystemVersion': '10.13',
'CFBundleShortVersionString': f"3.11.3.{BUILD_DATE} Beta",
'NSHumanReadableCopyright': u"Copyright © 2024, Dmitriy Yefremov",
'CFBundleShortVersionString': f"3.14.4.{BUILD_DATE} Beta",
'NSHumanReadableCopyright': u"Copyright © 2018-2026, Dmitriy Yefremov",
'NSRequiresAquaSystemAppearance': 'false',
'NSHighResolutionCapable': 'true'
})

View File

@@ -7,8 +7,7 @@ PATH_EXE = [os.path.join(DIR_PATH, EXE_NAME)]
block_cipher = None
excludes = ['app.tools.mpv',
'gi.repository.Gst',
excludes = ['gi.repository.Gst',
'gi.repository.GstBase',
'gi.repository.GstVideo',
'youtube_dl',
@@ -30,13 +29,13 @@ a = Analysis([EXE_NAME],
pathex=PATH_EXE,
binaries=[],
datas=ui_files,
hiddenimports=['fileinput', 'uuid', 'ctypes.wintypes', 'asyncio'],
hiddenimports=['fileinput', 'uuid', 'ctypes.wintypes', 'asyncio', 'getpass'],
hookspath=[],
runtime_hooks=[],
hooksconfig={
"gi": {
"languages": ["en", "be", "es", "it", "nl",
"pl", "pt", "ru", "tr", "zh_CN"],
"languages": ["en", "be", "es", "it", "nl", "pl",
"pt", "ru", "sk", "tr", "zh_CN"],
"module-versions": {
"Gtk": "3.0",
"GtkSource": "3",
@@ -48,9 +47,19 @@ a = Analysis([EXE_NAME],
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
splash = Splash('logo.png',
binaries=a.binaries,
datas=a.datas)
exe = EXE(pyz,
splash,
a.scripts,
[],
exclude_binaries=True,
@@ -59,13 +68,16 @@ exe = EXE(pyz,
bootloader_ignore_signals=False,
contents_directory='.',
strip=False,
upx=True,
upx=False,
console=False,
icon='icon.ico')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
splash.binaries,
strip=False,
upx=True,
upx_exclude=[],

View File

@@ -0,0 +1,26 @@
Subject: [PATCH] hide_splash
---
Index: app/ui/main.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/ui/main.py b/app/ui/main.py
--- a/app/ui/main.py (revision 0fc0ef1d3e80fc84f4da81e1117db63a1f1d3467)
+++ b/app/ui/main.py (date 1771419933854)
@@ -651,6 +651,15 @@
gen = self.init_http_api()
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
+ if hasattr(sys, "_MEIPASS"):
+ import pyi_splash
+
+ if pyi_splash.is_alive():
+ pyi_splash.close()
+
+ if self._main_window.is_suspended():
+ self._main_window.present()
+
def do_shutdown(self):
""" Performs shutdown tasks """
if self._settings.load_last_config:

BIN
build/win/logo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -1,14 +1,17 @@
#!/usr/bin/env python3
import os
import ssl
import sys
if __name__ == "__main__":
from multiprocessing import freeze_support
if hasattr(sys, "_MEIPASS"):
import os
import ssl
from multiprocessing import freeze_support
os.environ["PYTHONUTF8"] = "1"
freeze_support()
# TODO There needs to be a more "correct" way.
ssl._create_default_https_context = ssl._create_unverified_context
from app.ui.main import start_app
os.environ["PYTHONUTF8"] = "1"
# TODO There needs to be a more "correct" way.
ssl._create_default_https_context = ssl._create_unverified_context
freeze_support()
start_app()

View File

@@ -10,6 +10,7 @@ GenericName[nl]=Enigma2 boeket editor
GenericName[pl]=Edytor bukietów Enigma2
GenericName[pt]=Editor de buquês Enigma2
GenericName[ru]=Редактор букетов Enigma2
GenericName[sk]=Enigma2 editor balíčkov
GenericName[tr]=Enigma2 buket düzenleyici
GenericName[zh_CN]=Enigma2频道编辑器
Comment=Channel and satellite list editor for Enigma2
@@ -21,6 +22,7 @@ Comment[nl]=Kanaal- en satellietlijsteditor voor Enigma2
Comment[pl]=Edytor list kanałów i satelitów dla Enigma2
Comment[pt]=Editor de lista de canais e satélites para Enigma2
Comment[ru]=Редактор списка каналов и спутников для Enigma2
Comment[sk]=Editor zoznamu kanálov a satelitov pre Enigma2
Comment[tr]=Enigma2 için Kanal ve uydu listesi düzenleyici
Comment[zh_CN]=Enigma2频道和卫星列表编辑器
Icon=demon-editor

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2018-2024 Dmitriy Yefremov
# Copyright (C) 2018-2026 Dmitriy Yefremov
# This file is distributed under the MIT license.
#
#
@@ -11,7 +11,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
msgid "translator-credits"
msgstr ""
msgstr "Дзмітрый Яфрэмаў"
# Main
msgid "Service"
@@ -258,8 +258,14 @@ msgid "Extra:"
msgstr "Дадаткова:"
# Filter bar
msgid "Only free"
msgstr "Толькі адкрытыя"
msgid "Access"
msgstr "Доступ"
msgid "Free (FTA)"
msgstr "Адкрытыя (FTA)"
msgid "Coded"
msgstr "Закадаваныя"
msgid "All positions"
msgstr "Усе пазіцыі"
@@ -332,8 +338,8 @@ msgstr "Шлях да піконаў фармату Enigma2:"
msgid "Specify the correct position value for the provider!"
msgstr "Пакажыце правільнае значэнне пазіцыі для правайдара!"
msgid "Converter between name formats"
msgstr "Канвертар фармату імёнаў"
msgid "Converter between formats"
msgstr "Канвертар фарматаў"
msgid "Receive picons for providers"
msgstr "Атрыманне піконаў для правайдараў"
@@ -1554,3 +1560,57 @@ msgstr "Скарыстаць Streamrelay"
msgid "Remove use with Streamrelay"
msgstr "Не выкарыстоўваць Streamrelay"
msgid "Enable additional name cache for EPG"
msgstr "Уключыць дадатковы кэш імёнаў для EPG"
msgid "Enables additional cache to display EPG for some IPTV channels imported from *.m3u."
msgstr "Улучае дадатковы кэш для адлюстравання EPG некаторых каналаў IPTV імпартаваных з *.m3u."
msgid "Enable deep name comparison"
msgstr "Уключыць глыбокае параўнанне імёнаў"
msgid "Enables deeper name matching. Possible inaccuracies!"
msgstr "Дазваляе глыбейшае параўнанне імёнаў. Магчымы недакладнасці!"
msgid "Convert for selected bouquets"
msgstr "Канвертаваць для абраных букетаў"
msgid "There were errors [%s] during bouquets loading!"
msgstr "Пры загрузцы букетаў узніклі памылкі [%s]!"
msgid "Check the log for more info."
msgstr "Глядзіце логі для пашыранай інфармацыі."
msgid "Satellite channel"
msgstr "Спадарожнікавы канал"
msgid "Terrestrial channel"
msgstr "Эфірны канал"
msgid "Cable channel"
msgstr "Кабельны канал"
msgid "Save current changes"
msgstr "Захаваць бягучыя змены"
msgid "Create a new service"
msgstr "Стварыць новы сэрвіс"
msgid "Extension support is disabled!"
msgstr "Падтрымка пашырэнняў адключана!"
msgid "Do you want to enable it?"
msgstr "Жадаеце ўключыць?"
msgid "Playback of IPTV streams only!"
msgstr "Прайграванне толькі IPTV-патокаў!"
msgid "There are running background tasks!"
msgstr "Ідзе выкананне фонавых задач!"
msgid "Check if FFmpeg is installed!"
msgstr "Праверце, ці ўсталяваны FFmpeg!"
msgid "It can cause some problems."
msgstr "Гэта можа выклікаць некаторыя праблемы."

View File

@@ -1,8 +1,8 @@
# Copyright (C) 2018-2024 Dmitriy Yefremov
# Copyright (C) 2018-2026 Dmitriy Yefremov
# This file is distributed under the MIT license.
#
# Charly, 2019.
# Dmitriy Yefremov, 2020-2024.
# Dmitriy Yefremov, 2020-2026.
# Thomas Schmidt, 2021.
msgid ""
msgstr ""
@@ -260,8 +260,14 @@ msgid "Extra:"
msgstr "Extra:"
# Filter bar
msgid "Only free"
msgstr "Nur freie"
msgid "Access"
msgstr "Zugriff"
msgid "Free (FTA)"
msgstr "Freie (FTA)"
msgid "Coded"
msgstr "Codiert"
msgid "All positions"
msgstr "Alle Positionen"
@@ -334,8 +340,8 @@ msgstr "Pfad zu Enigma2-Picons:"
msgid "Specify the correct position value for the provider!"
msgstr "Geben Sie den richtigen Positionswert für den Provider an!"
msgid "Converter between name formats"
msgstr "Konverter zwischen Namensformaten"
msgid "Converter between formats"
msgstr "Konverter zwischen Formaten"
msgid "Receive picons for providers"
msgstr "Picons für Provider erhalten"
@@ -1568,3 +1574,57 @@ msgstr "Benutzung mit Streamrelay"
msgid "Remove use with Streamrelay"
msgstr "Streamrelay nutzung löschen"
msgid "Enable additional name cache for EPG"
msgstr "Zusätzlichen Namenscache für EPG aktivieren"
msgid "Enables additional cache to display EPG for some IPTV channels imported from *.m3u."
msgstr "Aktiviert zusätzlichen Cache zur Anzeige des EPG für einige IPTV-Kanäle, die aus *.m3u importiert wurden."
msgid "Enable deep name comparison"
msgstr "Tiefer Namensvergleich aktivieren"
msgid "Enables deeper name matching. Possible inaccuracies!"
msgstr "Aktiviert tiefere Namensübereinstimmung. Mögliche Ungenauigkeiten!"
msgid "Convert for selected bouquets"
msgstr "Konvertieren für ausgewählte Bouquets"
msgid "There were errors [%s] during bouquets loading!"
msgstr "Beim Laden der Bouquets sind Fehler [%s] aufgetreten!"
msgid "Check the log for more info."
msgstr "Weitere Informationen finden Sie im Log."
msgid "Satellite channel"
msgstr "Satellitenkanal"
msgid "Terrestrial channel"
msgstr "Terrestrischer Kanal"
msgid "Cable channel"
msgstr "Kabelkanal"
msgid "Save current changes"
msgstr "Aktuelle Änderungen speichern"
msgid "Create a new service"
msgstr "Erstellen eines neuen Service"
msgid "Extension support is disabled!"
msgstr "Die Unterstützung für Erweiterungen ist deaktiviert!"
msgid "Do you want to enable it?"
msgstr "Möchtest du aktivieren?"
msgid "Playback of IPTV streams only!"
msgstr "Wiedergabe nur IPTV-Streams!"
msgid "There are running background tasks!"
msgstr "Es laufen Hintergrundprozesse!"
msgid "Check if FFmpeg is installed!"
msgstr "Prüfe ob FFmpeg installiert ist!"
msgid "It can cause some problems."
msgstr "Das kann zu einigen Problemen führen."

View File

@@ -1,11 +1,11 @@
# Copyright (C) 2018-2024 Dmitriy Yefremov
# Copyright (C) 2018-2026 Dmitriy Yefremov
# This file is distributed under the MIT license.
#
# SPDX-FileCopyrightText: 2022, 2023, 2024 Massimo Pissarello <mapi68@gmail.com>
# SPDX-FileCopyrightText: 2022, 2023, 2024, 2025, 2026 Massimo Pissarello <mapi68@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: \n"
"PO-Revision-Date: 2024-08-16 08:21+0200\n"
"PO-Revision-Date: 2026-01-30 17:27+0100\n"
"Last-Translator: Massimo Pissarello <mapi68@gmail.com>\n"
"Language-Team: Italian <>\n"
"Language: it\n"
@@ -13,7 +13,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 24.05.2\n"
"X-Generator: Lokalize 25.12.1\n"
msgid "translator-credits"
msgstr "Massimo Pissarello\nNicola Fanghella"
@@ -263,8 +263,14 @@ msgid "Extra:"
msgstr "Extra:"
# Filter bar
msgid "Only free"
msgstr "Solo gratis"
msgid "Access"
msgstr "Accesso"
msgid "Free (FTA)"
msgstr "Libero (FTA)"
msgid "Coded"
msgstr "Codificato"
msgid "All positions"
msgstr "Tutte le posizioni"
@@ -726,7 +732,7 @@ msgid "XML file"
msgstr "File XML"
msgid "Use web source"
msgstr "Usa fonte web"
msgstr "Usa sorgente web"
msgid "Url to *.xml.gz file:"
msgstr "Da URL a file *.xml.gz:"
@@ -822,8 +828,8 @@ msgstr "Abilita barra di riproduzione diretta"
msgid "Enables direct sending and playback of media links on the receiver"
msgstr ""
"Abilita l'invio e la riproduzione diretta di collegamenti multimediali sul"
" ricevitore"
"Abilita invio e la riproduzione diretta di collegamenti multimediali sul ricev"
"itore"
msgid "Watch the channel in the program"
msgstr "Guarda canale nel programma"
@@ -1310,7 +1316,7 @@ msgid "Add picons"
msgstr "Aggiungi picon"
msgid "Logs"
msgstr "Registri"
msgstr "Log"
msgid "Title"
msgstr "Titolo"
@@ -1322,7 +1328,7 @@ msgid "Length"
msgstr "Durata"
msgid "Additional source"
msgstr "Fonte aggiuntiva"
msgstr "Sorgente aggiuntiva"
msgid "Automatically set the name selected in the favorites list."
msgstr "Imposta automaticamente il nome selezionato nell'elenco dei preferiti."
@@ -1410,8 +1416,8 @@ msgstr "Riproduci dall'elenco principale"
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr ""
"Abilita l'analisi degli URL utilizzando yt-dlp per ottenere collegamenti"
" diretti ai contenuti multimediali."
"Abilita analisi degli URL utilizzando yt-dlp per ottenere collegamenti diretti"
" ai contenuti multimediali."
msgid "Permissions..."
msgstr "Permessi..."
@@ -1464,8 +1470,8 @@ msgid ""
" selected.\n"
" Recommended only if you have external storage."
msgstr ""
"Abilita il caricamento come archivio compresso se viene selezionato un numero"
" elevato di picon (> 1000). Consigliato solo se si dispone di memoria esterna."
"Abilita caricamento come archivio compresso se viene selezionato un numero ele"
"vato di picon (> 1000). Consigliato solo se si dispone di memoria esterna."
msgid "Clear \"New\" flag"
msgstr "Rimuovi il flag \"Nuovo\""
@@ -1507,11 +1513,10 @@ msgid "Removed"
msgstr "Rimosso"
msgid "Enables overwriting existing main list services."
msgstr ""
"Abilita la sovrascrittura dei servizi esistenti dell'elenco principale."
msgstr "Abilita sovrascrittura dei servizi esistenti dell'elenco principale."
msgid "Enables skipping services import from lamedb."
msgstr "Abilita il salto dell'importazione dei servizi da lamedb."
msgstr "Abilita salto dell'importazione dei servizi da lamedb."
msgid "Bouquets data only"
msgstr "Bouquet solo dati"
@@ -1583,13 +1588,13 @@ msgid "Current EPG cache contents."
msgstr "Contenuto attuale cache EPG."
msgid "Source error!"
msgstr "Errore fonte!"
msgstr "Errore sorgente!"
msgid "The EPG source for the favorites list is not set!"
msgstr "La fonte EPG per l'elenco dei preferiti non è impostata!"
msgstr "La sorgente EPG per l'elenco dei preferiti non è impostata!"
msgid "Add to EPG sources list"
msgstr "Aggiungi all'elenco delle fonti EPG"
msgstr "Aggiungi all'elenco delle sorgenti EPG"
msgid "Current bouquet"
msgstr "Bouquet attuale"
@@ -1615,4 +1620,49 @@ msgstr "Usa con Streamrelay"
msgid "Remove use with Streamrelay"
msgstr "Rimuovi usa con Streamrelay"
msgid "Enable additional name cache for EPG"
msgstr "Abilita cache nomi aggiuntiva per EPG"
msgid ""
"Enables additional cache to display EPG for some IPTV channels imported from *"
".m3u."
msgstr ""
"Abilita una cache aggiuntiva per visualizzare l'EPG per alcuni canali IPTV imp"
"ortati da *.m3u."
msgid "Enable deep name comparison"
msgstr "Abilita confronto approfondito dei nomi"
msgid "Enables deeper name matching. Possible inaccuracies!"
msgstr ""
"Abilita una corrispondenza più approfondita dei nomi. Possibili imprecisioni!"
msgid "Convert for selected bouquets"
msgstr "Converti per i bouquet selezionati"
msgid "There were errors [%s] during bouquets loading!"
msgstr "Si sono verificati errori [%s] durante il caricamento dei bouquet!"
msgid "Check the log for more info."
msgstr "Per maggiori informazioni consulta il log."
msgid "Satellite channel"
msgstr "Canale satellitare"
msgid "Terrestrial channel"
msgstr "Canale terrestre"
msgid "Cable channel"
msgstr "Canale via cavo"
msgid "Save current changes"
msgstr "Salva le modifiche attuali"
msgid "Create a new service"
msgstr "Crea un nuovo servizio"
msgid "Extension support is disabled!"
msgstr "Il supporto dell'estensione è disabilitato!"
msgid "Do you want to enable it?"
msgstr "Vuoi abilitarlo?"

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2018-2024 Dmitriy Yefremov
# Copyright (C) 2018-2026 Dmitriy Yefremov
# This file is distributed under the MIT license.
#
#
@@ -11,7 +11,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
msgid "translator-credits"
msgstr ""
msgstr "Дмитрий Ефремов"
# Main
msgid "Service"
@@ -258,8 +258,14 @@ msgid "Extra:"
msgstr "Дополнительно:"
# Filter bar
msgid "Only free"
msgstr "Только открытые"
msgid "Access"
msgstr "Доступ"
msgid "Free (FTA)"
msgstr "Oткрытые (FTA)"
msgid "Coded"
msgstr "Закодированные"
msgid "All positions"
msgstr "Все позиции"
@@ -332,8 +338,8 @@ msgstr "Путь к пиконам формата Enigma2:"
msgid "Specify the correct position value for the provider!"
msgstr "Укажите правильное значение позиции для провайдера!"
msgid "Converter between name formats"
msgstr "Конвертер формата имен"
msgid "Converter between formats"
msgstr "Конвертер форматов"
msgid "Receive picons for providers"
msgstr "Получение пиконов для провайдеров"
@@ -1551,3 +1557,57 @@ msgstr "Использовать Streamrelay"
msgid "Remove use with Streamrelay"
msgstr "Не использовать Streamrelay"
msgid "Enable additional name cache for EPG"
msgstr "Включить дополнительный кэш имен для EPG"
msgid "Enables additional cache to display EPG for some IPTV channels imported from *.m3u."
msgstr "Включает дополнительный кэш для отображения EPG некоторых каналов IPTV импортированных из *.m3u."
msgid "Enable deep name comparison"
msgstr "Включить глубокое сравнение имен"
msgid "Enables deeper name matching. Possible inaccuracies!"
msgstr "Позволяет более глубокое сопоставление имен. Возможны неточности!"
msgid "Convert for selected bouquets"
msgstr "Конвертировать для выбранных букетов"
msgid "There were errors [%s] during bouquets loading!"
msgstr "При загрузке букетов возникли ошибки [%s]!"
msgid "Check the log for more info."
msgstr "Смотрите журнал для расширенной информации."
msgid "Satellite channel"
msgstr "Спутниковый канал"
msgid "Terrestrial channel"
msgstr "Эфирный канал"
msgid "Cable channel"
msgstr "Кабельный канал"
msgid "Save current changes"
msgstr "Сохранить текущие изменения"
msgid "Create a new service"
msgstr "Создать новый сервис"
msgid "Extension support is disabled!"
msgstr "Поддержка расширений отключена!"
msgid "Do you want to enable it?"
msgstr "Желаете включить?"
msgid "Playback of IPTV streams only!"
msgstr "Воспроизведение только IPTV-потоков!"
msgid "There are running background tasks!"
msgstr "Идет выполнение фоновых задач!"
msgid "Check if FFmpeg is installed!"
msgstr "Проверьте, установлен ли FFmpeg!"
msgid "It can cause some problems."
msgstr "Это может вызывать некоторые проблемы."

1603
po/sk/demon-editor.po Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: DemonEditor\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-04-16 15:59+0300\n"
"PO-Revision-Date: 2024-09-29 22:18+0300\n"
"PO-Revision-Date: 2026-01-25 17:07+0300\n"
"Last-Translator: audi06_19 <info@dreamosat-forum.com>\n"
"Language-Team: audi06_19 <info@dreamosat-forum.com>\n"
"Language: tr\n"
@@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.5\n"
"X-Generator: Poedit 3.8\n"
msgid "translator-credits"
msgstr "audi06_19 <info@dreamosat-forum.com>"
@@ -261,8 +261,14 @@ msgid "Extra:"
msgstr "Ekstra:"
# Filter bar
msgid "Only free"
msgstr "Sadece ücretsiz"
msgid "Access"
msgstr "Erişim"
msgid "Free (FTA)"
msgstr "Açık (FTA)"
msgid "Coded"
msgstr "Kodlanmış"
msgid "All positions"
msgstr "Tüm pozisyonlar"
@@ -335,8 +341,8 @@ msgstr "Enigma2 piconların yolu:"
msgid "Specify the correct position value for the provider!"
msgstr "Sağlayıcı için doğru pozisyon değerini belirtin!"
msgid "Converter between name formats"
msgstr "İsim formatları arasında dönüştürücü"
msgid "Converter between formats"
msgstr "Biçimler arasında dönüştürücü"
msgid "Receive picons for providers"
msgstr "Sağlayıcılar için picon alma"
@@ -1585,3 +1591,45 @@ msgstr "Streamrelay ile kullan"
msgid "Remove use with Streamrelay"
msgstr "Streamrelay ile kullanımı kaldır"
msgid "Enable additional name cache for EPG"
msgstr "EPG için ek ad önbelleğini etkinleştirin"
msgid "Enables additional cache to display EPG for some IPTV channels imported from *.m3u."
msgstr "*.m3u'dan içe aktarılan bazı IPTV kanalları için EPG'yi görüntülemek üzere ek önbelleği etkinleştirir."
msgid "Enable deep name comparison"
msgstr "Derin ad karşılaştırmasını etkinleştir"
msgid "Enables deeper name matching. Possible inaccuracies!"
msgstr "Daha derin isim eşleştirmesini etkinleştirir. Olası yanlışlıklar!"
msgid "Convert for selected bouquets"
msgstr "Seçili buketler için dönüştür"
msgid "There were errors [%s] during bouquets loading!"
msgstr "Buketler yüklenirken [%s] hata oluştu!"
msgid "Check the log for more info."
msgstr "Daha fazla bilgi için günlüğü kontrol edin."
msgid "Satellite channel"
msgstr "Uydu kanalı"
msgid "Terrestrial channel"
msgstr "Karasal kanal"
msgid "Cable channel"
msgstr "Kablo kanalı"
msgid "Save current changes"
msgstr "Mevcut değişiklikleri kaydet"
msgid "Create a new service"
msgstr "Yeni bir hizmet oluşturun"
msgid "Extension support is disabled!"
msgstr "Uzantı desteği devre dışı bırakıldı!"
msgid "Do you want to enable it?"
msgstr "Etkinleştirmek ister misiniz?"