From bf63f318555d7949522f3c04e6ecf82b5082feac Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Thu, 5 Oct 2023 11:57:58 +0300 Subject: [PATCH 001/203] - fixed compatability in plugins that do not inherit InfobarShowHide --- lib/python/Components/ServiceEventTracker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/python/Components/ServiceEventTracker.py b/lib/python/Components/ServiceEventTracker.py index 3c8b919de33..dcdd6486b7b 100644 --- a/lib/python/Components/ServiceEventTracker.py +++ b/lib/python/Components/ServiceEventTracker.py @@ -37,6 +37,7 @@ def infoBarClosed(infobar): x(infobar) def __init__(self, steal_current_service=False): + self.av_config = {} #add this here so to prevent crashes in plugins that doesnt inherit InfobarShowHide if steal_current_service: ServiceEventTracker.setActiveInfoBar(self, None, None) else: From 6a0b6e4f83bb42058724b3b8d72fac7eeabbfd9b Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Thu, 5 Oct 2023 11:38:53 +0000 Subject: [PATCH 002/203] PEP8 double aggressive E225 ~ E228 and E231 --- lib/python/Components/ServiceEventTracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Components/ServiceEventTracker.py b/lib/python/Components/ServiceEventTracker.py index dcdd6486b7b..f1a39aa20f3 100644 --- a/lib/python/Components/ServiceEventTracker.py +++ b/lib/python/Components/ServiceEventTracker.py @@ -37,7 +37,7 @@ def infoBarClosed(infobar): x(infobar) def __init__(self, steal_current_service=False): - self.av_config = {} #add this here so to prevent crashes in plugins that doesnt inherit InfobarShowHide + self.av_config = {} # add this here so to prevent crashes in plugins that doesnt inherit InfobarShowHide if steal_current_service: ServiceEventTracker.setActiveInfoBar(self, None, None) else: From 3a0e37ee8e9f57da14744ed05fbaf7702d9a13fb Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 14:21:53 +0200 Subject: [PATCH 003/203] Github workflow - use sigc3 source minimised for use in workflows --- .github/workflows/enigma2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/enigma2.yml b/.github/workflows/enigma2.yml index 2a4ab7dd548..33cca5b4040 100644 --- a/.github/workflows/enigma2.yml +++ b/.github/workflows/enigma2.yml @@ -91,7 +91,7 @@ jobs: echo "installing libsigc++-3" pushd . cd /tmp - git clone --depth 1 https://github.com/dbus-cxx/libsigc--3.0.git + git clone --depth 1 https://github.com/TwolDE2/libsigc--3.0.git cd libsigc--3.0 autoreconf -i ./configure From 1a9e6347e470028abf0c3cedc50e7b9ee595ebe1 Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 14:48:40 +0200 Subject: [PATCH 004/203] Tools - py3 and PEP8 to remove noise from Flake8 --- tools/create_picon_e1_to_e2.py | 10 +++--- tools/create_picon_links.py | 8 ++--- tools/create_picon_providers.py | 8 ++--- tools/create_picon_sats.py | 10 +++--- tools/enigma2.sh.in | 31 ------------------- tools/genmetaindex.py | 1 - .../host_tools/FormatConverter/datasource.py | 6 ++-- tools/host_tools/FormatConverter/input.py | 1 - tools/host_tools/FormatConverter/lamedb.py | 5 +-- .../FormatConverter/lamedb2satxml.py | 8 ++--- tools/host_tools/FormatConverter/main.py | 17 +++++----- tools/host_tools/FormatConverter/satxml.py | 7 ++--- 12 files changed, 38 insertions(+), 74 deletions(-) mode change 100644 => 100755 tools/genmetaindex.py mode change 100644 => 100755 tools/host_tools/FormatConverter/datasource.py mode change 100644 => 100755 tools/host_tools/FormatConverter/input.py mode change 100644 => 100755 tools/host_tools/FormatConverter/lamedb.py mode change 100644 => 100755 tools/host_tools/FormatConverter/lamedb2satxml.py mode change 100644 => 100755 tools/host_tools/FormatConverter/main.py diff --git a/tools/create_picon_e1_to_e2.py b/tools/create_picon_e1_to_e2.py index 58eb62b4b12..3c81c88d62e 100644 --- a/tools/create_picon_e1_to_e2.py +++ b/tools/create_picon_e1_to_e2.py @@ -33,11 +33,11 @@ sat = str(ref[1] / 16 / 16 / 16 / 16) -# SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1) -# X X X X D D + # SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1) + # X X X X D D -# REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED -# D D X X X X X X X X + # REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED + # D D X X X X X X X X refstr = "1:0:%X:%X:%X:%X:%X:0:0:0" % (ref[4], ref[0], ref[2], ref[3], ref[1]) refstr = refstr.replace(':', '_') @@ -61,7 +61,7 @@ filename = sat + "_" + provider + "_" + servicetype + "_" + filename sat = sat[0:2] + '.' + sat[-1:] + 'e' - #TODO: west + # TODO: west try: makedirs(sat + '/' + servicetype) diff --git a/tools/create_picon_links.py b/tools/create_picon_links.py index 3d69ddaad69..92871e93c24 100644 --- a/tools/create_picon_links.py +++ b/tools/create_picon_links.py @@ -19,11 +19,11 @@ name = name.replace('\xc2\x87', '').replace('\xc2\x86', '') -# SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1) -# X X X X D D + # SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1) + # X X X X D D -# REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED -# D D X X X X X X X X + # REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED + # D D X X X X X X X X refstr = "1:0:%X:%X:%X:%X:%X:0:0:0" % (ref[4], ref[0], ref[2], ref[3], ref[1]) refstr = refstr.replace(':', '_') diff --git a/tools/create_picon_providers.py b/tools/create_picon_providers.py index c2350e9c277..aac95beac22 100644 --- a/tools/create_picon_providers.py +++ b/tools/create_picon_providers.py @@ -32,11 +32,11 @@ sat = str(ref[1] / 16 / 16 / 16 / 16) -# SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1) -# X X X X D D + # SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1) + # X X X X D D -# REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED -# D D X X X X X X X X + # REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED + # D D X X X X X X X X refstr = "1:0:%X:%X:%X:%X:%X:0:0:0" % (ref[4], ref[0], ref[2], ref[3], ref[1]) refstr = refstr.replace(':', '_') diff --git a/tools/create_picon_sats.py b/tools/create_picon_sats.py index 38fc89e0522..58d1e7f3b8f 100644 --- a/tools/create_picon_sats.py +++ b/tools/create_picon_sats.py @@ -33,11 +33,11 @@ sat = str(ref[1] / 16 / 16 / 16 / 16) -# SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1) -# X X X X D D + # SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1) + # X X X X D D -# REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED -# D D X X X X X X X X + # REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED + # D D X X X X X X X X refstr = "1:0:%X:%X:%X:%X:%X:0:0:0" % (ref[4], ref[0], ref[2], ref[3], ref[1]) refstr = refstr.replace(':', '_') @@ -65,7 +65,7 @@ filename = sat + "_" + provider + "_" + servicetype + "_" + filename sat = sat[0:2] + '.' + sat[-1:] + 'e' - #TODO: west + # TODO: west try: makedirs(sat + '/' + servicetype) diff --git a/tools/enigma2.sh.in b/tools/enigma2.sh.in index f68e2ab2b67..2f8bdc978b6 100644 --- a/tools/enigma2.sh.in +++ b/tools/enigma2.sh.in @@ -84,23 +84,6 @@ if grep -q 'config\.crash\.logtimeformat' @sysconfdir@/enigma2/settings; then export ENIGMA_DEBUG_TIME=`grep "config\.crash\.logtimeformat" @sysconfdir@/enigma2/settings | sed -E "s/^.*=(.*)$/\1/" -` fi -# Enable generation of core dumps -debug_dir=$(sed -n 's/config.crash.debug_path=//p' @sysconfdir@/enigma2/settings) - [ -n "${debug_dir}" -a -d "${debug_dir}" ] || debug_dir=/home/root/logs/ -# It would be best to have this at system startup because this way we may not -# catch core dumps that happen early to enigma2. -# The kernel.core_pattern could be set via /etc/sysctl.conf. -# The size limit could be set via /etc/security/limits.conf. -if [ "$(grep -i config.crash.coredump=true /etc/enigma2/settings)" != "" ]; then - COREDUMPSIZE=$((10 * 512 * 4 - 1 * 512 * 4)) # size is in blocks (512 byte) so this sets 10 MB - 1 MB for log files - COREDUMPFILE=${debug_dir}%t-enigma2-core.dump - if [ "$(grep -i config.crash.sizeloglimit= /etc/enigma2/settings | sed 's/config.crash.sizeloglimit=//g')" != "" ]; then - COREDUMPSIZE=$(grep -i config.crash.sizeloglimit= /etc/enigma2/settings | sed 's/config.crash.sizeloglimit=//g') - COREDUMPSIZE=$((${COREDUMPSIZE} * 512 * 4 - 1 * 512 * 4)) - fi - echo ${COREDUMPFILE} > /proc/sys/kernel/core_pattern - ulimit -c ${COREDUMPSIZE} -fi # If we are running with a log then we need to set up a sub-process to # do this so that it can open a new log if the current one's size # becomes too large. @@ -322,20 +305,6 @@ else ret=$? fi -enigma2pid=$! - -# Enable generation of core dumps with ELF header included. -# This seem to be required by gdb. -# Would be default if kernel is configured with CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS. -# Default coredump filter can only be set via kernel command line. -# In all other cases this is only available per process. -if [ "$(grep -i config.crash.coredump=true /etc/enigma2/settings)" != "" ]; then - COREDUMPFILTER=0x33 - echo ${COREDUMPFILTER} > /proc/${enigma2pid}/coredump_filter -fi - -wait ${enigma2pid} - # enigma2 exit codes: # # 1 - halt diff --git a/tools/genmetaindex.py b/tools/genmetaindex.py old mode 100644 new mode 100755 index fc7a2d4b2a2..9422db6663b --- a/tools/genmetaindex.py +++ b/tools/genmetaindex.py @@ -1,7 +1,6 @@ # usage: genmetaindex.py > index.xml from os import path as ospath import sys -import os from xml.etree.ElementTree import ElementTree, Element root = Element("index") diff --git a/tools/host_tools/FormatConverter/datasource.py b/tools/host_tools/FormatConverter/datasource.py old mode 100644 new mode 100755 index e7a9c499430..0e2ddb4ca91 --- a/tools/host_tools/FormatConverter/datasource.py +++ b/tools/host_tools/FormatConverter/datasource.py @@ -1,5 +1,5 @@ from __future__ import print_function -from input import inputChoices +from . import input class datasource: @@ -66,7 +66,7 @@ def merge(self): def copymerge(self, action="copy"): choice = -1 while choice is not None: - choice = inputChoices(["select source", "select destination", "copy now!"]) + choice = input.inputChoices(["select source", "select destination", "copy now!"]) if choice == 0: print("\nselect source:") self.source = self.selectDatasource() @@ -106,7 +106,7 @@ def selectDatasource(self): if source != self: list.append(source.getName() + (" (%d sats)" % len(source.transponderlist.keys()))) sources.append(source) - choice = inputChoices(list) + choice = input.inputChoices(list) if choice is None: return None return sources[choice] diff --git a/tools/host_tools/FormatConverter/input.py b/tools/host_tools/FormatConverter/input.py old mode 100644 new mode 100755 index 62e2a4204f5..260916eb23d --- a/tools/host_tools/FormatConverter/input.py +++ b/tools/host_tools/FormatConverter/input.py @@ -1,4 +1,3 @@ -from __future__ import print_function import sys diff --git a/tools/host_tools/FormatConverter/lamedb.py b/tools/host_tools/FormatConverter/lamedb.py old mode 100644 new mode 100755 index ee6b489fb35..eaa2eb22121 --- a/tools/host_tools/FormatConverter/lamedb.py +++ b/tools/host_tools/FormatConverter/lamedb.py @@ -1,5 +1,4 @@ -from __future__ import print_function -from datasource import datasource +from . import datasource class lamedb(datasource): @@ -30,6 +29,8 @@ def read(self): transpondersreading = False sats = {} transponders = {} + tsid = None + onid = None for line in lines: if line.strip() == "transponders": transpondersreading = True diff --git a/tools/host_tools/FormatConverter/lamedb2satxml.py b/tools/host_tools/FormatConverter/lamedb2satxml.py old mode 100644 new mode 100755 index 89d8ef3f22a..6d251ae6918 --- a/tools/host_tools/FormatConverter/lamedb2satxml.py +++ b/tools/host_tools/FormatConverter/lamedb2satxml.py @@ -1,8 +1,8 @@ #!/usr/bin/python from __future__ import print_function -from datasource import genericdatasource -from satxml import satxml -from lamedb import lamedb +from . import datasource +from . import satxml +from . import lamedb import sys @@ -10,7 +10,7 @@ print("usage: %s " % sys.argv[0]) sys.exit() -gen = genericdatasource() +gen = datasource.genericdatasource() db = lamedb(sys.argv[1]) xml = satxml(sys.argv[2]) diff --git a/tools/host_tools/FormatConverter/main.py b/tools/host_tools/FormatConverter/main.py old mode 100644 new mode 100755 index 1a2aed56429..2a677d494fd --- a/tools/host_tools/FormatConverter/main.py +++ b/tools/host_tools/FormatConverter/main.py @@ -1,12 +1,12 @@ #!/usr/bin/python from os import system as ossystem -from datasource import genericdatasource -from satxml import satxml -from lamedb import lamedb -from input import * +from . import datasource +from . import satxml +from . import lamedb +from . import input -maindata = genericdatasource() +maindata = datasource.genericdatasource() sources = [satxml, lamedb] @@ -23,7 +23,7 @@ list = [] for index in list(range(len(datasources))): list.append(datasources[index].getName() + (" (%d sats)" % len(datasources[index].transponderlist.keys()))) - index = inputChoices(list, "q", "quit") + index = input.inputChoices(list, "q", "quit") if index is None: break @@ -32,11 +32,8 @@ list = [] for action in datasources[index].getCapabilities(): list.append(action[0]) - action = inputChoices(list) + action = input.inputChoices(list) if action is None: break datasources[index].getCapabilities()[action][1]() - #except: - # print sys.exc_info() - # print "sorry, could not execute that command" diff --git a/tools/host_tools/FormatConverter/satxml.py b/tools/host_tools/FormatConverter/satxml.py index 5631d748513..518ec958cb6 100644 --- a/tools/host_tools/FormatConverter/satxml.py +++ b/tools/host_tools/FormatConverter/satxml.py @@ -1,9 +1,8 @@ -from __future__ import print_function from os import path as ospath -from datasource import datasource +from . import datasource from xml.dom import minidom from xml.dom.minidom import Document -from input import inputText +from . import input class satxml(datasource): @@ -26,7 +25,7 @@ def getName(self): def setFilename(self): print("Please give a filename :") - filename = inputText() + filename = input.inputText() if filename == "": self.filename = "satellites.xml" else: From ae558b2643d6d776df92e78452a828656e192c29 Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 14:50:16 +0200 Subject: [PATCH 005/203] test - py3 and PEP8 to remove noise from Flake8 --- tests/enigma.py | 65 +++++++++++++++++++++------------------------ tests/events.py | 3 +-- tests/fake_time.py | 3 +-- tests/test_timer.py | 51 +++++++++++++++-------------------- 4 files changed, 54 insertions(+), 68 deletions(-) mode change 100644 => 100755 tests/enigma.py mode change 100644 => 100755 tests/events.py mode change 100644 => 100755 tests/fake_time.py diff --git a/tests/enigma.py b/tests/enigma.py old mode 100644 new mode 100755 index d04ea482b62..5fb81bad83a --- a/tests/enigma.py +++ b/tests/enigma.py @@ -1,4 +1,6 @@ -from __future__ import print_function +import time +from . import events + # fake-enigma @@ -16,11 +18,7 @@ def __call__(self): timers = set() -import time - -from events import eventfnc - -##################### ENIGMA BASE +# ENIGMA BASE class eTimer: @@ -86,7 +84,7 @@ def run(duration=1000): runIteration() -##################### ENIGMA GUI +# ENIGMA GUI eSize = None ePoint = None @@ -129,15 +127,15 @@ def __init__(self): self.m_event = slot() self.m_record_event = slot() - @eventfnc + @events.eventfnc def recordService(self, service): return iRecordableService(service) - @eventfnc + @events.eventfnc def stopRecordService(self, service): service.stop() - @eventfnc + @events.eventfnc def playService(self, service): return None @@ -176,15 +174,15 @@ class iRecordableService: def __init__(self, ref): self.ref = ref - @eventfnc + @events.eventfnc def prepare(self, filename, begin, end, event_id): return 0 - @eventfnc + @events.eventfnc def start(self): return 0 - @eventfnc + @events.eventfnc def stop(self): return 0 @@ -305,10 +303,10 @@ def info(self, ref): eServiceCenter() -##################### ENIGMA CHROOT +# ENIGMA CHROOT print("import directories") -import Tools.Directories +import Tools.Directories # noqa: E402 print("done") chroot = "." @@ -319,19 +317,16 @@ def info(self, ref): Tools.Directories.defaultPaths[Tools.Directories.SCOPE_SKIN] = ("../data/", Tools.Directories.PATH_DONTCREATE) Tools.Directories.defaultPaths[Tools.Directories.SCOPE_CONFIG] = ("/etc/enigma2/", Tools.Directories.PATH_DONTCREATE) -##################### ENIGMA CONFIG +# ENIGMA CONFIG print("import config") -import Components.config +import Components.config # noqa: E402 print("done") -my_config = [ -"config.skin.primary_skin=None\n" -] - +my_config = ["config.skin.primary_skin=None\n"] Components.config.config.unpickle(my_config) -##################### ENIGMA ACTIONS +# ENIGMA ACTIONS class eActionMap: @@ -339,24 +334,24 @@ def __init__(self): pass -##################### ENIGMA STARTUP: +# ENIGMA STARTUP: def init_nav(): print("init nav") - import Navigation - import NavigationInstance + import Navigation # noqa: E402 + import NavigationInstance # noqa: E402 NavigationInstance.instance = Navigation.Navigation() def init_record_config(): print("init recording") - import Components.RecordingConfig + import Components.RecordingConfig # noqa: E402 Components.RecordingConfig.InitRecordingConfig() def init_parental_control(): print("init parental") - from Components.ParentalControl import InitParentalControl + from Components.ParentalControl import InitParentalControl # noqa: E402 InitParentalControl() @@ -367,26 +362,26 @@ def init_all(): init_record_config() init_parental_control() - import Components.InputDevice + import Components.InputDevice # noqa: E402 Components.InputDevice.InitInputDevices() - import Components.AVSwitch + import Components.AVSwitch # noqa: E402 Components.AVSwitch.InitAVSwitch() - import Components.UsageConfig + import Components.UsageConfig # noqa: E402 Components.UsageConfig.InitUsageConfig() - import Components.Network + import Components.Network # noqa: E402 Components.Network.InitNetwork() - import Components.Lcd + import Components.Lcd # noqa: E402 Components.Lcd.InitLcd() - import Components.SetupDevices + import Components.SetupDevices # noqa: E402 Components.SetupDevices.InitSetupDevices() - import Components.RFmod + import Components.RFmod # noqa: E402 Components.RFmod.InitRFmod() - import Screens.Ci + import Screens.Ci # noqa: E402 Screens.Ci.InitCiConfig() diff --git a/tests/events.py b/tests/events.py old mode 100644 new mode 100755 index a2dcae3d54b..8a9310aac17 --- a/tests/events.py +++ b/tests/events.py @@ -1,6 +1,5 @@ -from __future__ import print_function import time -import tests +from . import tests recorded_events = [] diff --git a/tests/fake_time.py b/tests/fake_time.py old mode 100644 new mode 100755 index 0bf86c1d2e3..c35d2fb190a --- a/tests/fake_time.py +++ b/tests/fake_time.py @@ -1,4 +1,3 @@ -from __future__ import print_function import time real_time = None @@ -12,7 +11,7 @@ def setRealtime(): def setIdealtime(): global real_time - real_time = lambda: 0 + real_time = lambda: 0 # noqa: E731 def setTime(now): diff --git a/tests/test_timer.py b/tests/test_timer.py index bbd3887a4ec..7ff9d055e79 100644 --- a/tests/test_timer.py +++ b/tests/test_timer.py @@ -1,11 +1,12 @@ -from __future__ import print_function import time - -import enigma -import tests +import calendar +from os import environ +from . import enigma +from . import tests +from . import events -#enigma.reset() +# enigma.reset() def test_timer(repeat=0, timer_start=3600, timer_length=1000, sim_length=86400 * 7): import NavigationInstance @@ -25,20 +26,19 @@ def test_timer(repeat=0, timer_start=3600, timer_length=1000, sim_length=86400 * import RecordTimer timer = RecordTimer.createTimer(xml.etree.cElementTree.fromstring( - """ - - """ % (at + timer_start, at + timer_start + timer_length, repeat) - )) + """ + + """ % (at + timer_start, at + timer_start + timer_length, repeat))) t.record(timer) @@ -74,17 +74,10 @@ def test_timer(repeat=0, timer_start=3600, timer_length=1000, sim_length=86400 * enigma.init_record_config() enigma.init_parental_control() - -from events import log - -import calendar - - -from os import environ # we are operating in CET/CEST environ['TZ'] = 'CET' time.tzset() -#log(test_timer, test_name = "test_timer_repeating", base_time = calendar.timegm((2007, 3, 1, 12, 0, 0)), repeat=0x7f, sim_length = 86400 * 7) -log(test_timer, test_name="test_timer_repeating_dst_skip", base_time=calendar.timegm((2007, 0o3, 20, 0, 0, 0)), timer_start=3600, repeat=0x7f, sim_length=86400 * 7) -#log(test_timer, test_name = "test_timer_repeating_dst_start", base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), timer_start = 10000, repeat=0x7f, sim_length = 86400 * 7) +# events.log(test_timer, test_name = "test_timer_repeating", base_time = calendar.timegm((2007, 3, 1, 12, 0, 0)), repeat=0x7f, sim_length = 86400 * 7) +events.log(test_timer, test_name="test_timer_repeating_dst_skip", base_time=calendar.timegm((2007, 0o3, 20, 0, 0, 0)), timer_start=3600, repeat=0x7f, sim_length=86400 * 7) +# events.log(test_timer, test_name = "test_timer_repeating_dst_start", base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), timer_start = 10000, repeat=0x7f, sim_length = 86400 * 7) From 8ff099ab04d7ab3ab4cb3015a59b56cee6f3b19e Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Thu, 5 Oct 2023 12:51:15 +0000 Subject: [PATCH 006/203] chmod files --- tests/enigma.py | 0 tests/events.py | 0 tests/fake_time.py | 0 tools/genmetaindex.py | 0 tools/host_tools/FormatConverter/datasource.py | 0 tools/host_tools/FormatConverter/input.py | 0 tools/host_tools/FormatConverter/lamedb.py | 0 tools/host_tools/FormatConverter/lamedb2satxml.py | 0 tools/host_tools/FormatConverter/main.py | 0 9 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 tests/enigma.py mode change 100755 => 100644 tests/events.py mode change 100755 => 100644 tests/fake_time.py mode change 100755 => 100644 tools/genmetaindex.py mode change 100755 => 100644 tools/host_tools/FormatConverter/datasource.py mode change 100755 => 100644 tools/host_tools/FormatConverter/input.py mode change 100755 => 100644 tools/host_tools/FormatConverter/lamedb.py mode change 100755 => 100644 tools/host_tools/FormatConverter/lamedb2satxml.py mode change 100755 => 100644 tools/host_tools/FormatConverter/main.py diff --git a/tests/enigma.py b/tests/enigma.py old mode 100755 new mode 100644 diff --git a/tests/events.py b/tests/events.py old mode 100755 new mode 100644 diff --git a/tests/fake_time.py b/tests/fake_time.py old mode 100755 new mode 100644 diff --git a/tools/genmetaindex.py b/tools/genmetaindex.py old mode 100755 new mode 100644 diff --git a/tools/host_tools/FormatConverter/datasource.py b/tools/host_tools/FormatConverter/datasource.py old mode 100755 new mode 100644 diff --git a/tools/host_tools/FormatConverter/input.py b/tools/host_tools/FormatConverter/input.py old mode 100755 new mode 100644 diff --git a/tools/host_tools/FormatConverter/lamedb.py b/tools/host_tools/FormatConverter/lamedb.py old mode 100755 new mode 100644 diff --git a/tools/host_tools/FormatConverter/lamedb2satxml.py b/tools/host_tools/FormatConverter/lamedb2satxml.py old mode 100755 new mode 100644 diff --git a/tools/host_tools/FormatConverter/main.py b/tools/host_tools/FormatConverter/main.py old mode 100755 new mode 100644 From c7972c8c078ed4711dc3c9561db2d33d362e06f5 Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:32:15 +0200 Subject: [PATCH 007/203] [camcontrol] - use noqa to silence PEP8 flake8 noise --- lib/python/Tools/camcontrol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Tools/camcontrol.py b/lib/python/Tools/camcontrol.py index 8c44bcb8c06..f22f95bc194 100644 --- a/lib/python/Tools/camcontrol.py +++ b/lib/python/Tools/camcontrol.py @@ -32,7 +32,7 @@ def getConfigs(self, prefix): def current(self): try: - l = readlink(self.link) + l = readlink(self.link) # noqa: E741 prefix = self.name + '.' return path.split(l)[1].split(prefix, 2)[1] except: From d1cb16e44e3ad43c92db193cf689601b3ec46fe9 Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:32:44 +0200 Subject: [PATCH 008/203] Transponder - ensure space between # and text to silence PEP8 flake8 noise --- lib/python/Tools/Transponder.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/python/Tools/Transponder.py b/lib/python/Tools/Transponder.py index 90c1f76757c..d6899669989 100644 --- a/lib/python/Tools/Transponder.py +++ b/lib/python/Tools/Transponder.py @@ -170,7 +170,7 @@ def ConvertToHumanReadable(tp, tunertype=None): else: x = "" ret["bandwidth"] = x - #print('bandwidth:%s' % tp.get("bandwidth")) + # print('bandwidth:%s' % tp.get("bandwidth")) ret["code_rate_lp"] = { eDVBFrontendParametersTerrestrial.FEC_Auto: _("Auto"), eDVBFrontendParametersTerrestrial.FEC_1_2: "1/2", @@ -182,7 +182,7 @@ def ConvertToHumanReadable(tp, tunertype=None): eDVBFrontendParametersTerrestrial.FEC_6_7: "6/7", eDVBFrontendParametersTerrestrial.FEC_7_8: "7/8", eDVBFrontendParametersTerrestrial.FEC_8_9: "8/9"}.get(tp.get("code_rate_lp")) - #print 'code_rate_lp:',tp.get("code_rate_lp") + # print('code_rate_lp:', tp.get("code_rate_lp") ret["code_rate_hp"] = { eDVBFrontendParametersTerrestrial.FEC_Auto: _("Auto"), eDVBFrontendParametersTerrestrial.FEC_1_2: "1/2", @@ -194,14 +194,14 @@ def ConvertToHumanReadable(tp, tunertype=None): eDVBFrontendParametersTerrestrial.FEC_6_7: "6/7", eDVBFrontendParametersTerrestrial.FEC_7_8: "7/8", eDVBFrontendParametersTerrestrial.FEC_8_9: "8/9"}.get(tp.get("code_rate_hp")) - #print 'code_rate_hp:',tp.get("code_rate_hp") + # print('code_rate_hp:', tp.get("code_rate_hp") ret["constellation"] = { eDVBFrontendParametersTerrestrial.Modulation_Auto: _("Auto"), eDVBFrontendParametersTerrestrial.Modulation_QPSK: "QPSK", eDVBFrontendParametersTerrestrial.Modulation_QAM16: "QAM16", eDVBFrontendParametersTerrestrial.Modulation_QAM64: "QAM64", eDVBFrontendParametersTerrestrial.Modulation_QAM256: "QAM256"}.get(tp.get("constellation")) - #print 'constellation:',tp.get("constellation") + # print('constellation:', tp.get("constellation") ret["transmission_mode"] = { eDVBFrontendParametersTerrestrial.TransmissionMode_Auto: _("Auto"), eDVBFrontendParametersTerrestrial.TransmissionMode_1k: "1k", @@ -210,7 +210,7 @@ def ConvertToHumanReadable(tp, tunertype=None): eDVBFrontendParametersTerrestrial.TransmissionMode_8k: "8k", eDVBFrontendParametersTerrestrial.TransmissionMode_16k: "16k", eDVBFrontendParametersTerrestrial.TransmissionMode_32k: "32k"}.get(tp.get("transmission_mode")) - #print 'transmission_mode:',tp.get("transmission_mode") + # print('transmission_mode:', tp.get("transmission_mode") ret["guard_interval"] = { eDVBFrontendParametersTerrestrial.GuardInterval_Auto: _("Auto"), eDVBFrontendParametersTerrestrial.GuardInterval_19_256: "19/256", @@ -220,26 +220,26 @@ def ConvertToHumanReadable(tp, tunertype=None): eDVBFrontendParametersTerrestrial.GuardInterval_1_16: "1/16", eDVBFrontendParametersTerrestrial.GuardInterval_1_8: "1/8", eDVBFrontendParametersTerrestrial.GuardInterval_1_4: "1/4"}.get(tp.get("guard_interval")) - #print 'guard_interval:',tp.get("guard_interval") + # print('guard_interval:', tp.get("guard_interval") ret["hierarchy_information"] = { eDVBFrontendParametersTerrestrial.Hierarchy_Auto: _("Auto"), eDVBFrontendParametersTerrestrial.Hierarchy_None: _("None"), eDVBFrontendParametersTerrestrial.Hierarchy_1: "1", eDVBFrontendParametersTerrestrial.Hierarchy_2: "2", eDVBFrontendParametersTerrestrial.Hierarchy_4: "4"}.get(tp.get("hierarchy_information")) - #print 'hierarchy_information:',tp.get("hierarchy_information") + # print('hierarchy_information:', tp.get("hierarchy_information") ret["inversion"] = { eDVBFrontendParametersTerrestrial.Inversion_Unknown: _("Auto"), eDVBFrontendParametersTerrestrial.Inversion_On: _("On"), eDVBFrontendParametersTerrestrial.Inversion_Off: _("Off")}.get(tp.get("inversion")) - #print 'inversion:',tp.get("inversion") + # print('inversion:', tp.get("inversion") ret["system"] = { eDVBFrontendParametersTerrestrial.System_DVB_T_T2: "DVB-T/T2", eDVBFrontendParametersTerrestrial.System_DVB_T: "DVB-T", eDVBFrontendParametersTerrestrial.System_DVB_T2: "DVB-T2"}.get(tp.get("system")) -# print 'system:',tp.get("system") + # print('system:', tp.get("system") ret["frequency"] = (tp.get("frequency") and ('%s MHz' % str(round(tp.get("frequency") / 1000000., 3)))) or '0 MHz' -# print 'frequency:',tp.get("frequency") + # print('frequency:', tp.get("frequency") ret["channel"] = _("CH%s") % getChannelNumber(tp.get("frequency"), "DVB-T") elif tunertype == "ATSC": ret["tuner_type"] = "ATSC" @@ -260,7 +260,7 @@ def ConvertToHumanReadable(tp, tunertype=None): eDVBFrontendParametersATSC.System_ATSC: "ATSC", eDVBFrontendParametersATSC.System_DVB_C_ANNEX_B: "DVB-C ANNEX B"}.get(tp.get("system")) elif tunertype != "None": - print("ConvertToHumanReadable: no or unknown tunertype in tpdata dict for tunertype:", tunertype) + print('ConvertToHumanReadable: no or unknown tunertype in tpdata dict for tunertype:', tunertype) for k, v in tp.items(): if k not in ret: ret[k] = v From 14d5a4603c8c9e92f05196e2104faf8bb98b06ca Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:33:06 +0200 Subject: [PATCH 009/203] XMLTools - use noqa to silence PEP8 flake8 noise --- lib/python/Tools/XMLTools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Tools/XMLTools.py b/lib/python/Tools/XMLTools.py index 5debc03ab2e..4690bc2e204 100644 --- a/lib/python/Tools/XMLTools.py +++ b/lib/python/Tools/XMLTools.py @@ -9,7 +9,7 @@ def elementsWithTag(el, tag): # fiiixme! (works but isn't nice) if isinstance(tag, str): s = tag - tag = lambda x: x == s + tag = lambda x: x == s # noqa: E731 for x in el: if x.nodeType != xml.dom.minidom.Element.nodeType: From eab3353f246638b0d83317d91acbb819edc641b0 Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:33:30 +0200 Subject: [PATCH 010/203] NumericalTextInput - silence needed import - but flake8 says not used with noqa: F401 --- lib/python/Tools/NumericalTextInput.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Tools/NumericalTextInput.py b/lib/python/Tools/NumericalTextInput.py index 1dbfa049360..8049997d739 100644 --- a/lib/python/Tools/NumericalTextInput.py +++ b/lib/python/Tools/NumericalTextInput.py @@ -1,7 +1,7 @@ from os import environ from enigma import eTimer - -from Components.Language import language # DO NOT REMOVE THIS IMPORT - NEEDED TO RESOLVE path/language/locales +# DO NOT REMOVE import language - NEEDED TO RESOLVE path/language/locales +from Components.Language import language # noqa: F401 MAP_SEARCH_UPCASE = "SearchUpper" # NOTE: Legacy interface for previous and deprecated versions of NumericalTextInput. MAP_SEARCH = "SearchLower" From 47e9be38cacd8a434fe998c1f9684e97a9355ecb Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:34:04 +0200 Subject: [PATCH 011/203] [Multiboot] - remove unused mkdir import and align comments with code for PEP8 --- lib/python/Tools/Multiboot.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/python/Tools/Multiboot.py b/lib/python/Tools/Multiboot.py index e753d5147ee..236e794f9b1 100644 --- a/lib/python/Tools/Multiboot.py +++ b/lib/python/Tools/Multiboot.py @@ -2,7 +2,7 @@ import glob import subprocess import tempfile -from os import mkdir, path, rmdir, rename, remove, sep, stat +from os import path, rmdir, rename, sep, stat from boxbranding import getMachineMtdRoot from Components.Console import Console @@ -37,7 +37,7 @@ def getMultibootslots(): print("[multiboot*****][getMultibootslots]00 device, bootslots", device, " ", bootslots) if len(bootslots) != 0: break -# print("[multiboot*****][getMultibootslots]0 device = ", device) + # print("[multiboot*****][getMultibootslots]0 device = ", device) if path.exists(device): print("[multiboot*****][getMultibootslots]path found for device = ", device) Console(binary=True).ePopen("mount %s %s" % (device, tmpname)) @@ -63,7 +63,7 @@ def getMultibootslots(): print("[multiboot] [getMultibootslots3] slot = %s file = %s" % (slotnumber, slotname)) if slotnumber.isdigit() and slotnumber not in bootslots: line = open(file).read().replace("'", "").replace('"', "").replace("\n", " ").replace("ubi.mtd", "mtd").replace("bootargs=", "") -# print("[Multiboot][getMultibootslots]6 readlines = %s " % line) + # print("[Multiboot][getMultibootslots]6 readlines = %s " % line) slot = dict([(x.split("=", 1)[0].strip(), x.split("=", 1)[1].strip()) for x in line.strip().split(" ") if "=" in x]) if slotnumber == "0": slot["slotType"] = "" @@ -94,7 +94,7 @@ def getMultibootslots(): if "kernel" not in slot.keys(): slot["kernel"] = "%sp%s" % (slot["root"].split("p")[0], int(slot["root"].split("p")[1]) - 1) # oldstyle MB kernel = root-1 - # print("[multiboot] [getMultibootslots]7a HasMultibootMTD, kernel, root, SystemInfo['HasRootSubdir'] ", SystemInfo["HasMultibootMTD"], " ", slot["kernel"], " ", slot["root"], " ", SystemInfo["HasRootSubdir"]) + # print("[multiboot] [getMultibootslots]7a HasMultibootMTD, kernel, root, SystemInfo['HasRootSubdir'] ", SystemInfo["HasMultibootMTD"], " ", slot["kernel"], " ", slot["root"], " ", SystemInfo["HasRootSubdir"]) else: continue bootslots[int(slotnumber)] = slot @@ -107,7 +107,7 @@ def getMultibootslots(): if not path.ismount(tmp.dir): rmdir(tmp.dir) if bootslots: -# print("[Multiboot] Bootslots found:", bootslots) + # print("[Multiboot] Bootslots found:", bootslots) bootArgs = open("/sys/firmware/devicetree/base/chosen/bootargs", "r").read() print("[Multiboot][MultiBootSlot] bootArgs:", bootArgs) if fileHas("/proc/cmdline", "kexec=1") and SystemInfo["HasRootSubdir"]: # Kexec Vu+ receiver @@ -116,7 +116,7 @@ def getMultibootslots(): SystemInfo["MultiBootSlot"] = int(rootsubdir[0].rsplit(char, 1)[1][11:]) SystemInfo["VuUUIDSlot"] = (UUID, UUIDnum) if UUIDnum != 0 else "" print("[Multiboot][MultiBootSlot]0 current slot used:", SystemInfo["MultiBootSlot"]) -# print("[Multiboot][MultiBootSlot]0 UID, UUIDnum:", SystemInfo["VuUUIDSlot"], " ", SystemInfo["VuUUIDSlot"][0], " ", SystemInfo["VuUUIDSlot"][1]) + # print("[Multiboot][MultiBootSlot]0 UID, UUIDnum:", SystemInfo["VuUUIDSlot"], " ", SystemInfo["VuUUIDSlot"][0], " ", SystemInfo["VuUUIDSlot"][1]) elif SystemInfo["HasRootSubdir"] and "root=/dev/sda" not in bootArgs: # RootSubdir receiver or sf8008 receiver with root in eMMC slot slot = [x[-1] for x in bootArgs.split() if x.startswith("rootsubdir")] SystemInfo["MultiBootSlot"] = int(slot[0]) @@ -134,12 +134,12 @@ def getMultibootslots(): def getUUIDtoSD(UUID): # returns None on failure -# print("[multiboot][getUUIDtoSD2] UUID = ", UUID) + # print("[multiboot][getUUIDtoSD2] UUID = ", UUID) check = "/sbin/blkid" if fileExists(check): lines = subprocess.check_output([check]).decode(encoding="utf8", errors="ignore").split("\n") for line in lines: -# print("[Multiboot][getUUIDtoSD2] line", line) + # print("[Multiboot][getUUIDtoSD2] line", line) if UUID in line.replace('"', ''): return line.split(":")[0].strip() else: @@ -174,15 +174,15 @@ def GetImagelist(Recovery=None): else: Console(binary=True).ePopen("mount %s %s" % (SystemInfo["canMultiBoot"][slot]["root"], tmpname)) imagedir = sep.join([_f for _f in [tmpname, SystemInfo["canMultiBoot"][slot].get("rootsubdir", "")] if _f]) -# print("[multiboot] [GetImagelist]0 isfile = %s" % (path.join(imagedir, "usr/bin/enigma2"))) + # print("[multiboot] [GetImagelist]0 isfile = %s" % (path.join(imagedir, "usr/bin/enigma2"))) if path.isfile(path.join(imagedir, "usr/bin/enigma2")): -# print("[multiboot] [GetImagelist]1 Slot = %s imagedir = %s" % (slot, imagedir)) + # print("[multiboot] [GetImagelist]1 Slot = %s imagedir = %s" % (slot, imagedir)) if path.isfile(path.join(imagedir, "usr/lib/enigma.info")): print("[multiboot] [BoxInfo] using BoxInfo") BuildVersion = createInfo(slot, imagedir=imagedir) -# print("[multiboot] [BoxInfo] slot=%s, BuildVersion=%s" % (slot, BuildVersion)) + # print("[multiboot] [BoxInfo] slot=%s, BuildVersion=%s" % (slot, BuildVersion)) else: -# print("[multiboot] [BoxInfo] using BoxBranding") + # print("[multiboot] [BoxInfo] using BoxBranding") print("[multiboot] [GetImagelist] 2 slot = %s imagedir = %s" % (slot, imagedir)) Creator = open("%s/etc/issue" % imagedir).readlines()[-2].capitalize().strip()[:-6] print("[multiboot] [GetImagelist] Creator = %s imagedir = %s" % (Creator, imagedir)) @@ -197,12 +197,12 @@ def GetImagelist(Recovery=None): BuildVersion = "%s %s %s %s (%s)" % (Creator, BuildType[0:3], Build, Dev, date) elif fileHas("/proc/cmdline", "kexec=1") and path.isfile(path.join(imagedir, "etc/vtiversion.info")): Vti = open(path.join(imagedir, "etc/vtiversion.info")).read() -# print("[BootInfo]6 vti = ", Vti) + # print("[BootInfo]6 vti = ", Vti) date = VerDate(imagedir) Creator = Vti[0:3] Build = Vti[-8:-1] BuildVersion = "%s %s (%s) " % (Creator, Build, date) -# print("[BootInfo]8 BuildVersion = ", BuildVersion ) + # print("[BootInfo]8 BuildVersion = ", BuildVersion ) else: date = VerDate(imagedir) Creator = Creator.replace("-release", " ") @@ -360,7 +360,6 @@ def readBrandingFile(self): # Reads boxbranding.so and updates self.output if output: for att in list(self.output.keys()): self.output[att] = output[att] - # print("[readBrandingFile1] self.output = %s" % self.output) def addBrandingMethods(self): # This creates reader.getBoxType(), reader.getImageDevBuild(), etc loc = {} From 86c34795ea66a5524de774aa093cd3aadb71b84d Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:34:46 +0200 Subject: [PATCH 012/203] [Hex2strColor] - silence PEP8 noqa W605 --- lib/python/Tools/Hex2strColor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Tools/Hex2strColor.py b/lib/python/Tools/Hex2strColor.py index ed3d1bc17cb..4bb4e98f790 100644 --- a/lib/python/Tools/Hex2strColor.py +++ b/lib/python/Tools/Hex2strColor.py @@ -3,4 +3,4 @@ def Hex2strColor(rgb): - return "\c%08x" % rgb + return "\c%08x" % rgb # noqa: W605 From e910aa41512d8289df18e67a39eb32ece7699c3a Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:35:03 +0200 Subject: [PATCH 013/203] [Hardwareinfo] - align comment with code silence PEP8 --- lib/python/Tools/HardwareInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Tools/HardwareInfo.py b/lib/python/Tools/HardwareInfo.py index 20fa6d6f2c6..3ccc31b8ff2 100644 --- a/lib/python/Tools/HardwareInfo.py +++ b/lib/python/Tools/HardwareInfo.py @@ -8,7 +8,7 @@ class HardwareInfo: def __init__(self): if HardwareInfo.device_name is not None: -# print "using cached result" + # print "using cached result" return HardwareInfo.device_name = "unknown" From 428e32ad51b0d14610a061783153e104aa034e81 Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:35:18 +0200 Subject: [PATCH 014/203] [General] - silence PEP8 --- lib/python/Tools/General.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/python/Tools/General.py b/lib/python/Tools/General.py index abe70c4b51b..1ae18983950 100644 --- a/lib/python/Tools/General.py +++ b/lib/python/Tools/General.py @@ -1,6 +1,5 @@ from enigma import iServiceInformation, eServiceReference, eServiceCenter - def isIPTV(service): path = service and service.getPath() return path and not path.startswith("/") and service.type in [0x1, 0x1001, 0x138A, 0x1389] From 31e7a8518e58ba04c83545af456113ea5b17b268 Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:35:34 +0200 Subject: [PATCH 015/203] [FuzzyDate] - silence PEP8 noqa E704 --- lib/python/Tools/FuzzyDate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Tools/FuzzyDate.py b/lib/python/Tools/FuzzyDate.py index 5d4d8723779..a8fa01d18c8 100644 --- a/lib/python/Tools/FuzzyDate.py +++ b/lib/python/Tools/FuzzyDate.py @@ -33,7 +33,7 @@ def FuzzyTime(t, inPast=False): if __name__ == "__main__": - def _(x): return x + def _(x): return x # noqa: E704 print("now: %s %s" % FuzzyTime(time())) for i in range(1, 14): print("+%2s day(s): %s " % (i, FuzzyTime(time() + 86400 * i))) From ae6b113ab6658aaa91a06f8399f85d4ee57ba8b6 Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:35:56 +0200 Subject: [PATCH 016/203] [Directories] - silence PEP8 no err required --- lib/python/Tools/Directories.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Tools/Directories.py b/lib/python/Tools/Directories.py index cd03f619559..6eb56becee0 100644 --- a/lib/python/Tools/Directories.py +++ b/lib/python/Tools/Directories.py @@ -283,7 +283,7 @@ def fileWriteLine(filename, line, *args, **kwargs): with open(filename, "w") as fd: fd.write(str(line)) return 1 - except (IOError, OSError) as err: + except (IOError, OSError): print_exc() return 0 @@ -307,7 +307,7 @@ def fileWriteLines(filename, lines, *args, **kwargs): lines = "\n".join(lines) fd.write(lines) return 1 - except (IOError, OSError) as err: + except (IOError, OSError): print_exc() return 0 From 2328f408a6c91837d8f207aac1940237645f2cad Mon Sep 17 00:00:00 2001 From: Twol Date: Thu, 5 Oct 2023 15:36:50 +0200 Subject: [PATCH 017/203] po/xml2po use r with re variable and noqa to remove noise from Flake8 --- po/xml2po.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/xml2po.py b/po/xml2po.py index 6e978643b43..df10336ab87 100644 --- a/po/xml2po.py +++ b/po/xml2po.py @@ -1,6 +1,5 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from __future__ import print_function import six import sys @@ -23,7 +22,7 @@ def __init__(self, attrlist): self.isPointsElement, self.isReboundsElement = 0, 0 self.attrlist = attrlist self.last_comment = None - self.ishex = re.compile('#[0-9a-fA-F]+\Z') + self.ishex = re.compile(r'#[0-9a-fA-F]+\Z') def comment(self, comment): if "TRANSLATORS:" in comment: @@ -65,7 +64,7 @@ def startElement(self, name, attrs): print('#: ' + arg) k.replace("\\n", "\"\n\"") if c: - for l in c.split('\n'): + for l in c.split('\n'): # noqa: E741 print("#. ", l) print('msgid "' + six.ensure_str(k) + '"') print('msgstr ""') From f5ada9bf7a0aee5925c3590c8bb458f16817b10d Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Thu, 5 Oct 2023 13:40:01 +0000 Subject: [PATCH 018/203] PEP8 double aggressive E301 ~ E306 --- lib/python/Tools/General.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/python/Tools/General.py b/lib/python/Tools/General.py index 1ae18983950..abe70c4b51b 100644 --- a/lib/python/Tools/General.py +++ b/lib/python/Tools/General.py @@ -1,5 +1,6 @@ from enigma import iServiceInformation, eServiceReference, eServiceCenter + def isIPTV(service): path = service and service.getPath() return path and not path.startswith("/") and service.type in [0x1, 0x1001, 0x138A, 0x1389] From 108eb0b5144b329c8521258d6e6e62db450fcf1b Mon Sep 17 00:00:00 2001 From: Taapat Date: Wed, 27 Sep 2023 19:25:02 +0300 Subject: [PATCH 019/203] Refreshes the extensions menu if it displays a job with progress --- lib/python/Screens/InfoBarGenerics.py | 47 +++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index bdda1479b48..f2c8ed2ba84 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -2688,6 +2688,38 @@ def __init__(self): from Screens.PiPSetup import PiPSetup # noqa: E402 +class ExtensionsList(ChoiceBox): + def __init__(self, session, clist, keys, refresh_list): + ChoiceBox.__init__(self, session, title=_("Please choose an extension..."), list=clist, keys=keys, skin_name="ExtensionsList", reorderConfig="extension_order", windowTitle=_("Extensions menu")) + if refresh_list: + self.refresh_timer = eTimer() + self.refresh_timer.callback.append(self.update_list) + self.refresh_timer.start(1000) + + def update_list(self): + updated = False + removed = [] + for idx, x in enumerate(self.list): + text = x[0][1][0]() + if x[0][0] != text: # Update text if changed + x[0] = (text, *x[0][1:]) + x[1] = x[1][:7] + (text,) + self.summarylist[idx] = (self.summarylist[idx][0], text) + updated = True + elif not x[0][1][2](): # Remove job if not active + updated = True + removed.append(idx) + if updated: + for idx, x in enumerate(removed): + del self.list[x - idx] + del self.summarylist[x - idx] + self["list"].setList(self.list) + self.updateSummary(self["list"].getSelectionIndex()) + if removed: + for f in self.onLayoutFinish: # For screen resize + exec(f) + + class InfoBarExtensions: EXTENSION_SINGLE = 0 EXTENSION_LIST = 1 @@ -2781,7 +2813,7 @@ def addExtension(self, extension, key=None, type=EXTENSION_SINGLE): def updateExtension(self, extension, key=None): self.extensionsList.append(extension) - if key is not None and key in self.extensionKeys: + if key not in (None, "refresh") and key in self.extensionKeys: key = None if key is None: @@ -2808,22 +2840,22 @@ def showExtensionSelection(self): self.updateExtensions() extensionsList = self.extensionsList[:] keys = [] - list = [] + clist = [] for x in self.availableKeys: if x in self.extensionKeys: entry = self.extensionKeys[x] extension = self.extensionsList[entry] if extension[2](): name = str(extension[0]()) # noqa: F841 variable 'name' assigned, not used - list.append((extension[0](), extension)) + clist.append((extension[0](), extension)) keys.append(x) extensionsList.remove(extension) else: extensionsList.remove(extension) - list.extend([(x[0](), x) for x in extensionsList]) + clist.extend([(x[0](), x) for x in extensionsList]) keys += [""] * len(extensionsList) - self.session.openWithCallback(self.extensionCallback, ChoiceBox, title=_("Please choose an extension"), list=list, keys=keys, skin_name="ExtensionsList", reorderConfig="extension_order") + self.session.openWithCallback(self.extensionCallback, ExtensionsList, clist=clist, keys=keys, refresh_list="refresh" in self.extensionKeys) def extensionCallback(self, answer): if answer is not None: @@ -2966,7 +2998,7 @@ def __init__(self): def getJobList(self): if config.usage.jobtaskextensions.value: - return [((boundFunction(self.getJobName, job), boundFunction(self.showJobView, job), lambda: True), None) for job in job_manager.getPendingJobs()] + return [((boundFunction(self.getJobName, job), boundFunction(self.showJobView, job), boundFunction(self.isActiveJob, job)), "refresh") for job in job_manager.getPendingJobs()] else: return [] @@ -2978,6 +3010,9 @@ def showJobView(self, job): job_manager.in_background = False self.session.openWithCallback(self.JobViewCB, JobView, job) + def isActiveJob(self, job): + return job.status in (job.IN_PROGRESS, job.NOT_STARTED) + def JobViewCB(self, in_background): job_manager.in_background = in_background From b140b6f2d1e42bec3653b2316fea8d23cdaa99df Mon Sep 17 00:00:00 2001 From: Huevos Date: Thu, 5 Oct 2023 01:30:03 +0200 Subject: [PATCH 020/203] [InfoBarGenerics] Move PiPSetup import before InfoBarPiP class --- lib/python/Screens/InfoBarGenerics.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index f2c8ed2ba84..94e99665f81 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -2685,9 +2685,6 @@ def __init__(self): }, description=_("Open the movie list")) -from Screens.PiPSetup import PiPSetup # noqa: E402 - - class ExtensionsList(ChoiceBox): def __init__(self, session, clist, keys, refresh_list): ChoiceBox.__init__(self, session, title=_("Please choose an extension..."), list=clist, keys=keys, skin_name="ExtensionsList", reorderConfig="extension_order", windowTitle=_("Extensions menu")) @@ -3018,6 +3015,8 @@ def JobViewCB(self, in_background): # depends on InfoBarExtensions +from Screens.PiPSetup import PiPSetup # noqa: E402 + class InfoBarPiP: def __init__(self): From c5af90ce35e69772317098ddbf8f3ee19c4d86e7 Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Fri, 6 Oct 2023 12:39:53 +0000 Subject: [PATCH 021/203] PEP8 double aggressive E301 ~ E306 --- lib/python/Screens/InfoBarGenerics.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 94e99665f81..8e8af349850 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -3015,6 +3015,7 @@ def JobViewCB(self, in_background): # depends on InfoBarExtensions + from Screens.PiPSetup import PiPSetup # noqa: E402 From e534cb61fe8d328bcc2ba4becc0cd4efe54f9cd4 Mon Sep 17 00:00:00 2001 From: Twol Date: Fri, 6 Oct 2023 16:02:45 +0200 Subject: [PATCH 022/203] Multiboot - remove old Boxbranding.so code --- lib/python/Tools/Multiboot.py | 100 +--------------------------------- 1 file changed, 1 insertion(+), 99 deletions(-) diff --git a/lib/python/Tools/Multiboot.py b/lib/python/Tools/Multiboot.py index 236e794f9b1..f4330a7bb74 100644 --- a/lib/python/Tools/Multiboot.py +++ b/lib/python/Tools/Multiboot.py @@ -186,16 +186,7 @@ def GetImagelist(Recovery=None): print("[multiboot] [GetImagelist] 2 slot = %s imagedir = %s" % (slot, imagedir)) Creator = open("%s/etc/issue" % imagedir).readlines()[-2].capitalize().strip()[:-6] print("[multiboot] [GetImagelist] Creator = %s imagedir = %s" % (Creator, imagedir)) - if Creator.startswith("Openvix"): - reader = boxbranding_reader(imagedir) - BuildType = reader.getImageType() - Build = reader.getImageBuild() - Creator = Creator.replace("-release", " rel") -# print("[multiboot] [GetImagelist]5 Slot = %s Creator = %s BuildType = %s Build = %s" % (slot, Creator, BuildType, Build)) - Dev = BuildType != "release" and " %s" % reader.getImageDevBuild() or "" - date = VerDate(imagedir) - BuildVersion = "%s %s %s %s (%s)" % (Creator, BuildType[0:3], Build, Dev, date) - elif fileHas("/proc/cmdline", "kexec=1") and path.isfile(path.join(imagedir, "etc/vtiversion.info")): + if fileHas("/proc/cmdline", "kexec=1") and path.isfile(path.join(imagedir, "etc/vtiversion.info")): Vti = open(path.join(imagedir, "etc/vtiversion.info")).read() # print("[BootInfo]6 vti = ", Vti) date = VerDate(imagedir) @@ -310,92 +301,3 @@ def restoreSlots(): Console(binary=True).ePopen("umount %s" % tmp.dir) if not path.ismount(tmp.dir): rmdir(tmp.dir) - - -class boxbranding_reader: # Many thanks to Huevos for creating this reader - well beyond my skill levels! - def __init__(self, OsPath): - if path.exists("%s/usr/lib64" % OsPath): - self.branding_path = "%s/usr/lib64/enigma2/python/" % OsPath - else: - self.branding_path = "%s/usr/lib/enigma2/python/" % OsPath - self.branding_file = "boxbranding.so" - self.tmp_path = "/tmp/" - self.helper_file = "helper.py" - - self.output = { - "getMachineBuild": "", - "getMachineProcModel": "", - "getMachineBrand": "", - "getMachineName": "", - "getMachineMtdKernel": "", - "getMachineKernelFile": "", - "getMachineMtdRoot": "", - "getMachineRootFile": "", - "getMachineMKUBIFS": "", - "getMachineUBINIZE": "", - "getBoxType": "", - "getBrandOEM": "", - "getOEVersion": "", - "getDriverDate": "", - "getImageVersion": "", - "getImageBuild": "", - "getImageDistro": "", - "getImageFolder": "", - "getImageFileSystem": "", - "getImageDevBuild": "", - "getImageType": "", - "getMachineMake": "", - "getImageArch": "", - "getFeedsUrl": "", - } - self.createHelperFile() - self.copyBrandingFile() - self.readBrandingFile() - self.removeHelperFile() - self.removeBrandingFile() - self.addBrandingMethods() - - def readBrandingFile(self): # Reads boxbranding.so and updates self.output - output = eval(subprocess.check_output(["python", path.join(self.tmp_path, self.helper_file)])) - if output: - for att in list(self.output.keys()): - self.output[att] = output[att] - - def addBrandingMethods(self): # This creates reader.getBoxType(), reader.getImageDevBuild(), etc - loc = {} - for att in list(self.output.keys()): - exec("def %s(self): return self.output[\"%s\"]" % (att, att), None, loc) - for name, value in list(loc.items()): - setattr(boxbranding_reader, name, value) - - def createHelperFile(self): - f = open(path.join(self.tmp_path, self.helper_file), "w+") - f.write(self.helperFileContent()) - f.close() - - def copyBrandingFile(self): - shutil.copy2(path.join(self.branding_path, self.branding_file), path.join(self.tmp_path, self.branding_file)) - - def removeHelperFile(self): - self.removeFile(path.join(self.tmp_path, self.helper_file)) - - def removeBrandingFile(self): - self.removeFile(path.join(self.tmp_path, self.branding_file)) - - def removeFile(self, toRemove): - if path.isfile(toRemove): - remove(toRemove) - - def helperFileContent(self): - out = [] - out.append("try:") - out.append("\timport boxbranding") - out.append("\toutput = {") - for att in list(self.output.keys()): - out.append("\t\t\"%s\": boxbranding.%s()," % (att, att)) - out.append("\t}") - out.append("except Exception:") - out.append("\t\toutput = None") - out.append("print(output)") - out.append("") - return "\n".join(out) From 015b51f783164cd61c4e2106fa1259fca1e28ed8 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 16:22:22 +0200 Subject: [PATCH 023/203] [Pixmap] allows the image in ePixmap to be set directly from Pixmap.py if required Author: @DimitarCC --- lib/python/Components/Pixmap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/python/Components/Pixmap.py b/lib/python/Components/Pixmap.py index 13d7f359205..b636eb5dedf 100644 --- a/lib/python/Components/Pixmap.py +++ b/lib/python/Components/Pixmap.py @@ -19,6 +19,9 @@ def getSize(self): s = self.instance.size() return s.width(), s.height() + def setPixmap(self, pixmap): + self.instance.setPixmap(pixmap) + def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] From 6ded218c7e286961bae8c9827f8266f3d307a03d Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 16:40:50 +0200 Subject: [PATCH 024/203] [listboxservice] reorder... ...so selection border pngs are rendered below the content. Otherwise the border pngs overlap the content. Use alphablending so png transparency show correctly. Author: @DimitarCC --- lib/service/listboxservice.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/service/listboxservice.cpp b/lib/service/listboxservice.cpp index 2787cbd9015..895fac20e18 100644 --- a/lib/service/listboxservice.cpp +++ b/lib/service/listboxservice.cpp @@ -714,6 +714,13 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const if (cursorValid()) { + if (selected && local_style && local_style->m_selection) + painter.blit(local_style->m_selection, offset, eRect(), gPainter::BT_ALPHABLEND); + + // Draw the frame for selected item here so to be under the content + if (selected && (!local_style || !local_style->m_selection)) + style.drawFrame(painter, eRect(offset, m_itemsize), eWindowStyle::frameListboxEntry); + /* get service information */ ePtr service_info; m_service_center->info(*m_cursor, service_info); @@ -757,9 +764,6 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const painter.setForegroundColor(gRGB(0xb40431)); } - if (selected && local_style && local_style->m_selection) - painter.blit(local_style->m_selection, offset, eRect(), gPainter::BT_ALPHABLEND); - int xoffset=0; // used as offset when painting the folder/marker symbol or the serviceevent progress int nameLeft=0, nameWidth=0, nameYoffs=0, nextYoffs=0; // used as temporary values for 'show two lines' option @@ -1127,8 +1131,6 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const } } } - if (selected && (!local_style || !local_style->m_selection)) - style.drawFrame(painter, eRect(offset, m_itemsize), eWindowStyle::frameListboxEntry); eRect area = m_element_position[celServiceEventProgressbar]; if (area.width() > 0 && evt && !m_element_font[celServiceEventProgressbar]) From a56062b6fc0293ae74c00a14b50ed32a343585a4 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 17:02:54 +0200 Subject: [PATCH 025/203] [Menu.py] PEP noise --- lib/python/Screens/Menu.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/python/Screens/Menu.py b/lib/python/Screens/Menu.py index 75b0c821350..bc105236914 100644 --- a/lib/python/Screens/Menu.py +++ b/lib/python/Screens/Menu.py @@ -2,7 +2,7 @@ from Components.ActionMap import HelpableNumberActionMap, HelpableActionMap from Components.config import config, ConfigDictionarySet, configfile, NoSave -from Components.NimManager import nimmanager +from Components.NimManager import nimmanager # noqa: F401 # used in menu.xml conditionals from Components.Pixmap import Pixmap from Components.PluginComponent import plugins from Components.Sources.List import List @@ -105,7 +105,7 @@ def addMenu(self, destList, node): a = boundFunction(self.session.openWithCallback, self.menuClosedWithConfigFlush, Menu, node) else: a = boundFunction(self.session.openWithCallback, self.menuClosed, Menu, node) - #TODO add check if !empty(node.childNodes) + # TODO add check if !empty(node.childNodes) destList.append((menu_text, a, key, weight, description, menupng)) def menuClosedWithConfigFlush(self, *res): @@ -289,24 +289,24 @@ def createMenuList(self): if self.menuID is not None: # plugins - for l, description in plugins.getPluginsForMenuWithDescription(self.menuID): + for plugin, description in plugins.getPluginsForMenuWithDescription(self.menuID): # check if a plugin overrides an existing menu - plugin_menuid = l[2] + plugin_menuid = plugin[2] for x in self.list: if x[2] == plugin_menuid: self.list.remove(x) break - menupng = MenuEntryPixmap(l[2], self.png_cache) - self.list.append((l[0], boundFunction(l[1], self.session, close=self.close), l[2], l[3] or 50, description, menupng)) + menupng = MenuEntryPixmap(plugin[2], self.png_cache) + self.list.append((plugin[0], boundFunction(plugin[1], self.session, close=self.close), plugin[2], plugin[3] or 50, description, menupng)) if "user" in config.usage.menu_sort_mode.value and self.menuID == "mainmenu": plugin_list = [] id_list = [] - for l in plugins.getPlugins([PluginDescriptor.WHERE_PLUGINMENU, PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_EVENTINFO]): - l.id = (l.name.lower()).replace(' ', '_') - if l.id not in id_list: - id_list.append(l.id) - plugin_list.append((l.name, boundFunction(l.fnc, self.session), l.id, 200)) + for plugin in plugins.getPlugins([PluginDescriptor.WHERE_PLUGINMENU, PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_EVENTINFO]): + plugin.id = (plugin.name.lower()).replace(' ', '_') + if plugin.id not in id_list: + id_list.append(plugin.id) + plugin_list.append((plugin.name, boundFunction(plugin.fnc, self.session), plugin.id, 200)) if self.menuID is not None and "user" in config.usage.menu_sort_mode.value: self.sub_menu_sort = NoSave(ConfigDictionarySet()) @@ -507,7 +507,7 @@ def moveChoosen(self, direction): class MainMenu(Menu): - #add file load functions for the xml-file + # add file load functions for the xml-file def __init__(self, *x): Menu.__init__(self, *x) From 473763e9e755ee2029d3b4259e263218d86826c6 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 17:25:30 +0200 Subject: [PATCH 026/203] [ChoiceList] update icon handling Do we want graphical separator (solid line with color) or dashed line. Separate the sizes definition for keybutton is=cons and the rest so there to be possibility to use different size images for different type icons. --- lib/python/Components/ChoiceList.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/python/Components/ChoiceList.py b/lib/python/Components/ChoiceList.py index 93f5c91f6f9..fbd0cbfe083 100644 --- a/lib/python/Components/ChoiceList.py +++ b/lib/python/Components/ChoiceList.py @@ -1,5 +1,6 @@ -from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont +from enigma import RT_HALIGN_LEFT, RT_VALIGN_CENTER, eListboxPythonMultiContent, gFont from Components.MenuList import MenuList +from Components.MultiContent import MultiContentEntryText from Tools.Directories import fileExists, SCOPE_CURRENT_SKIN, resolveFilename from Tools.LoadPixmap import LoadPixmap from skin import applySkinFactor, fonts, parameters @@ -15,12 +16,27 @@ def ChoiceEntryComponent(key=None, text=None): text = ["--"] res = [text] if text[0] == "--": + # Do we want graphical separator (solid line with color) or dashed line + isUseGraphicalSeparator = parameters.get("ChoicelistUseGraphicalSeparator", 0) x, y, w, h = parameters.get("ChoicelistDash", applySkinFactor(0, 2, 800, 25)) - res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, "-" * 200)) + if isUseGraphicalSeparator: + bk_color = parameters.get("ChoicelistSeparatorColor", "0x00555556") + res.append( + MultiContentEntryText( + pos=(x, y + 20), + size=(w, 2), + font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER, + text="", + color=None, color_sel=None, + backcolor=bk_color, backcolor_sel=bk_color)) + else: + res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, "-" * 200)) else: - x, y, w, h = parameters.get("ChoicelistName", applySkinFactor(45, 2, 800, 25)) - res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, text[0])) if key: + x, y, w, h = parameters.get("ChoicelistName", applySkinFactor(45, 2, 800, 25)) + res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, text[0])) + # separate the sizes definition for keybutton is=cons and the rest so there to be possibility to use different size images for different type icons + iconKeyConfigName = "ChoicelistIcon" if key == "expandable": pngfile = resolveFilename(SCOPE_CURRENT_SKIN, "icons/expandable.png") elif key == "expanded": @@ -30,10 +46,11 @@ def ChoiceEntryComponent(key=None, text=None): elif key == "bullet": pngfile = resolveFilename(SCOPE_CURRENT_SKIN, "icons/bullet.png") else: + iconKeyConfigName = "ChoicelistButtonIcon" pngfile = resolveFilename(SCOPE_CURRENT_SKIN, "buttons/key_%s.png" % key) if fileExists(pngfile): png = LoadPixmap(pngfile) - x, y, w, h = parameters.get("ChoicelistIcon", (applySkinFactor(5), applySkinFactor(0), png.size().width(), png.size().height())) + x, y, w, h = parameters.get(iconKeyConfigName, (applySkinFactor(5), applySkinFactor(0), png.size().width(), png.size().height())) res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, x, y, w, h, png)) return res From fdeea6818abaecbf48f9aa38da772dbc245abcc7 Mon Sep 17 00:00:00 2001 From: Twol Date: Fri, 6 Oct 2023 18:38:51 +0200 Subject: [PATCH 027/203] [enigma2.sh.in] reinstate core-dump --- tools/enigma2.sh.in | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tools/enigma2.sh.in b/tools/enigma2.sh.in index 2f8bdc978b6..f68e2ab2b67 100644 --- a/tools/enigma2.sh.in +++ b/tools/enigma2.sh.in @@ -84,6 +84,23 @@ if grep -q 'config\.crash\.logtimeformat' @sysconfdir@/enigma2/settings; then export ENIGMA_DEBUG_TIME=`grep "config\.crash\.logtimeformat" @sysconfdir@/enigma2/settings | sed -E "s/^.*=(.*)$/\1/" -` fi +# Enable generation of core dumps +debug_dir=$(sed -n 's/config.crash.debug_path=//p' @sysconfdir@/enigma2/settings) + [ -n "${debug_dir}" -a -d "${debug_dir}" ] || debug_dir=/home/root/logs/ +# It would be best to have this at system startup because this way we may not +# catch core dumps that happen early to enigma2. +# The kernel.core_pattern could be set via /etc/sysctl.conf. +# The size limit could be set via /etc/security/limits.conf. +if [ "$(grep -i config.crash.coredump=true /etc/enigma2/settings)" != "" ]; then + COREDUMPSIZE=$((10 * 512 * 4 - 1 * 512 * 4)) # size is in blocks (512 byte) so this sets 10 MB - 1 MB for log files + COREDUMPFILE=${debug_dir}%t-enigma2-core.dump + if [ "$(grep -i config.crash.sizeloglimit= /etc/enigma2/settings | sed 's/config.crash.sizeloglimit=//g')" != "" ]; then + COREDUMPSIZE=$(grep -i config.crash.sizeloglimit= /etc/enigma2/settings | sed 's/config.crash.sizeloglimit=//g') + COREDUMPSIZE=$((${COREDUMPSIZE} * 512 * 4 - 1 * 512 * 4)) + fi + echo ${COREDUMPFILE} > /proc/sys/kernel/core_pattern + ulimit -c ${COREDUMPSIZE} +fi # If we are running with a log then we need to set up a sub-process to # do this so that it can open a new log if the current one's size # becomes too large. @@ -305,6 +322,20 @@ else ret=$? fi +enigma2pid=$! + +# Enable generation of core dumps with ELF header included. +# This seem to be required by gdb. +# Would be default if kernel is configured with CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS. +# Default coredump filter can only be set via kernel command line. +# In all other cases this is only available per process. +if [ "$(grep -i config.crash.coredump=true /etc/enigma2/settings)" != "" ]; then + COREDUMPFILTER=0x33 + echo ${COREDUMPFILTER} > /proc/${enigma2pid}/coredump_filter +fi + +wait ${enigma2pid} + # enigma2 exit codes: # # 1 - halt From c0423a66566d14f64a2e9556a2554b3858078188 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 19:35:29 +0200 Subject: [PATCH 028/203] [PowerTimer] local variable 'old_end' is assigned to but never used --- lib/python/PowerTimer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/python/PowerTimer.py b/lib/python/PowerTimer.py index 5f092064350..b621f01deb0 100644 --- a/lib/python/PowerTimer.py +++ b/lib/python/PowerTimer.py @@ -269,7 +269,6 @@ def activate(self): return True elif next_state == self.StateEnded: - old_end = self.end NavigationInstance.instance.PowerTimer.saveTimer() if self.afterEvent == AFTEREVENT.STANDBY: if not Screens.Standby.inStandby: # not already in standby From 418d43345e9427aa1a27d2b0215fe4bfc95f526d Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 19:40:03 +0200 Subject: [PATCH 029/203] [RecordTimer] PEP noise --- lib/python/RecordTimer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/python/RecordTimer.py b/lib/python/RecordTimer.py index cb07b32adfb..802de4ce302 100644 --- a/lib/python/RecordTimer.py +++ b/lib/python/RecordTimer.py @@ -992,10 +992,10 @@ def createTimer(xml): if flags: entry.flags = set(flags.encode("utf-8").split(" ")) - for l in xml.findall("log"): - time = int(l.get("time")) - code = int(l.get("code")) - msg = str(l.text.strip()) + for x in xml.findall("log"): + time = int(x.get("time")) + code = int(x.get("code")) + msg = str(x.text.strip()) entry.log_entries.append((time, code, msg)) return entry @@ -1025,7 +1025,7 @@ def doActivate(self, w, dosave=True): # when activating a timer for servicetype 4097, # and SystemApp has player enabled, then skip recording. # Or always skip if in ("5001", "5002") as these cannot be recorded. - if w.service_ref.toString().startswith("4097:") and Directories.isPluginInstalled("ServiceApp") and config.plugins.serviceapp.servicemp3.replace.value == True or w.service_ref.toString()[:4] in ("5001", "5002"): + if w.service_ref.toString().startswith("4097:") and Directories.isPluginInstalled("ServiceApp") and config.plugins.serviceapp.servicemp3.replace.value is True or w.service_ref.toString()[:4] in ("5001", "5002"): print("[RecordTimer][doActivate] found Serviceapp & player enabled - disable this timer recording") w.state = RecordTimerEntry.StateEnded from Tools.Notifications import AddPopup From cacb4e962e3d22317b48a65412b96bddc68ae50a Mon Sep 17 00:00:00 2001 From: Twol Date: Fri, 6 Oct 2023 19:58:59 +0200 Subject: [PATCH 030/203] [Playlist} - import path as ospath --- lib/python/Components/Playlist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Components/Playlist.py b/lib/python/Components/Playlist.py index 30db8c4ff9d..eea2827cdd7 100644 --- a/lib/python/Components/Playlist.py +++ b/lib/python/Components/Playlist.py @@ -1,4 +1,4 @@ -from os import ospath +from os import path as ospath from enigma import eServiceReference from ServiceReference import ServiceReference From 097d9ecaa102581cedd8ff1d5f3a4a5d28796228 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 19:52:29 +0200 Subject: [PATCH 031/203] [CCcamInfo] PEP noise --- lib/python/Screens/CCcamInfo.py | 82 ++++++++++++++++----------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/python/Screens/CCcamInfo.py b/lib/python/Screens/CCcamInfo.py index 507a4e75372..2e8fafaa1e4 100644 --- a/lib/python/Screens/CCcamInfo.py +++ b/lib/python/Screens/CCcamInfo.py @@ -140,8 +140,8 @@ def translateBlock(block): ############################################################# -def getConfigValue(l): - list = l.split(":") +def getConfigValue(x): + list = x.split(":") ret = "" if len(list) > 1: @@ -464,17 +464,17 @@ def readConfig(self): try: f = open(CFG, 'r') - for l in f: - if l.startswith('WEBINFO LISTEN PORT :'): - port = getConfigValue(l) + for x in f: + if x.startswith('WEBINFO LISTEN PORT :'): + port = getConfigValue(x) if port != "": self.url = self.url.replace('16001', port) - elif l.startswith('WEBINFO USERNAME :'): - username = getConfigValue(l) + elif x.startswith('WEBINFO USERNAME :'): + username = getConfigValue(x) - elif l.startswith('WEBINFO PASSWORD :'): - password = getConfigValue(l) + elif x.startswith('WEBINFO PASSWORD :'): + password = getConfigValue(x) f.close() except: @@ -496,7 +496,7 @@ def profileSelected(self, url=None): self.showInfo(_("Using old profile: ") + self.url, _("Profile")) def keyNumberGlobal(self, idx): - if self.working == False and (idx < len(self.menu_list)): + if self.working is False and (idx < len(self.menu_list)): self.working = True sel = self.menu_list[idx] @@ -642,12 +642,12 @@ def showCCcamClients(self, html): infoList = [] lines = html.split("\n") - for l in lines: - if l.__contains__('|'): + for x in lines: + if x.__contains__('|'): if firstLine: firstLine = False else: - list = l.split('|') + list = x.split('|') if len(list) > 8: username = list[1].replace(" ", "") if username != "": @@ -674,12 +674,12 @@ def showCCcamServers(self, html): infoList = [] lines = html.split("\n") - for l in lines: - if l.__contains__('|'): + for x in lines: + if x.__contains__('|'): if firstLine: firstLine = False else: - list = l.split('|') + list = x.split('|') if len(list) > 7: hostname = list[1].replace(" ", "") if hostname != "": @@ -705,12 +705,12 @@ def showCCcamShares(self, html): infoList = [] lines = html.split("\n") - for l in lines: - if l.__contains__('|'): + for x in lines: + if x.__contains__('|'): if firstLine: firstLine = False else: - list = l.split('|') + list = x.split('|') if len(list) > 7: hostname = list[1].replace(" ", "") if hostname != "": @@ -890,7 +890,7 @@ def getProviders(self): getPage(self.url + "/providers", self.readProvidersCallback, self.readError) def readError(self, error=None): -# self.session.open(MessageBox, _("Error reading webpage!"), MessageBox.TYPE_ERROR) + # self.session.open(MessageBox, _("Error reading webpage!"), MessageBox.TYPE_ERROR) self.working = False def readSharesCallback(self, html): @@ -909,12 +909,12 @@ def readSharesCallback(self, html): ulevel = 0 lines = html.split("\n") - for l in lines: - if l.__contains__('|'): + for x in lines: + if x.__contains__('|'): if firstLine: firstLine = False else: - list = l.split("|") + list = x.split("|") if len(list) > 7: hostname = list[1].replace(" ", "") if hostname != "": @@ -934,8 +934,8 @@ def readSharesCallback(self, html): countList.append(count) numberofcards = count providername = self.providers.get(caidprovider, 'Multiple Providers given') - #if providername == 'Multiple Providers given': - # print caidprovider + # if providername == 'Multiple Providers given': + # print caidprovider numberofreshare = 0 if int(down) > 0: resharecards += 1 @@ -1003,8 +1003,8 @@ def readSharesCallback(self, html): countList.append(count) numberofcards = count providername = self.providers.get(caidprovider, 'Multiple Providers given') - #if providername == 'Multiple Providers given': - # print caidprovider + # if providername == 'Multiple Providers given': + # print caidprovider numberofreshare = 0 if int(down) > 0: @@ -1026,8 +1026,8 @@ def readSharesCallback(self, html): if int(down) > 0: reshare = reshareList[i] reshare += 1 - #if caidprovider == "05021700": - # print "re: %d" %(reshare) + # if caidprovider == "05021700": + # print "re: %d" %(reshare) reshareList[i] = reshare numberofreshare = 0 numberofreshare = reshare @@ -1041,12 +1041,12 @@ def readSharesCallback(self, html): self.hostList.append(hostname) self.caidList.append(caidprovider) totalcards += 1 - #maxdown = list[6] - #while maxdown.startswith(" "): - #maxdown = maxdown[1:] - #down = maxdown - #if int(down)>0: - #resharecards +=1 + # maxdown = list[6] + # while maxdown.startswith(" "): + # maxdown = maxdown[1:] + # down = maxdown + # if int(down)>0: + # resharecards +=1 self.instance.setTitle("%s (%s %d) %s %s" % (_("Share View"), _("Total cards:"), totalcards, _("Hops:"), ulevel)) self["title"].setText("%s (%s %d) %s %s" % (_("Share View"), _("Total cards:"), totalcards, _("Hops:"), ulevel)) @@ -1060,12 +1060,12 @@ def readSharesCallback(self, html): def readProvidersCallback(self, html): firstLine = True lines = html.split("\n") - for l in lines: - if l.__contains__('|'): + for x in lines: + if x.__contains__('|'): if firstLine: firstLine = False else: - list = l.split('|') + list = x.split('|') if len(list) > 5: caid = list[1].replace(" ", "") if caid != "": @@ -1440,12 +1440,12 @@ def readSharesCallback(self, html): count = 0 lines = html.split("\n") - for l in lines: - if l.__contains__('|'): + for x in lines: + if x.__contains__('|'): if firstLine: firstLine = False else: - list = l.split("|") + list = x.split("|") if len(list) > 7: hostname = list[1].replace(" ", "") if (self.hostname == "None" or self.hostname == hostname) and hostname != "": From 97f1aada7304b45ead4993082b7cfa624199dba9 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 19:56:12 +0200 Subject: [PATCH 032/203] [ChannelSelection] pep noise --- lib/python/Screens/ChannelSelection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 1b271a7f433..9b363223849 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -1275,10 +1275,10 @@ def doContext(self): self.session.openWithCallback(self.exitContext, ChannelContextMenu, self) def exitContext(self, close=False): - l = self["list"] - l.setFontsize() - l.setItemsPerPage() - l.setMode('MODE_TV') + x = self["list"] + x.setFontsize() + x.setItemsPerPage() + x.setMode('MODE_TV') # l.setMode('MODE_TV') automatically sets "hide number marker" to # the config.usage.hide_number_markers.value so when we are in "movemode" From e3d972f0c7bb2489764e3ffa618eaf1c985e1d03 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 19:59:08 +0200 Subject: [PATCH 033/203] [InfoBarGenerics] variables assigned, never used --- lib/python/Screens/InfoBarGenerics.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 8e8af349850..f9b6b2483ff 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -933,14 +933,13 @@ def avChange(self): audio_pid = pickle_loads(av_val.encode()) audio = service and service.audioTracks() playinga_idx = audio and audio.getCurrentTrack() - n = audio and audio.getNumberOfTracks() or 0 if audio_pid and audio_pid != -1 and playinga_idx != audio_pid: audio.selectTrack(audio_pid) self.enableSubtitle(subs_pid) self._waitForEventInfoTimer.stop() - except Exception as e: + except: self._waitForEventInfoTimer.stop() From 91ab9da9ac2c420dfc4e8ed8cc1c13239461fd1f Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 20:08:31 +0200 Subject: [PATCH 034/203] [InfoBarGenerics] pep noise --- lib/python/Screens/InfoBarGenerics.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index f9b6b2483ff..a58729e576b 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -1158,7 +1158,7 @@ def recallPrevService(self, reply): bouquet = eServiceReference(bqrootstr) bouquetlist = serviceHandler.list(bouquet) service = None - if not bouquetlist is None: + if bouquetlist is not None: while True: bouquet = bouquetlist.getNext() if not bouquet.valid(): @@ -1167,7 +1167,7 @@ def recallPrevService(self, reply): self.servicelist.clearPath() self.servicelist.setRoot(bouquet) servicelist = serviceHandler.list(bouquet) - if not servicelist is None: + if servicelist is not None: serviceIterator = servicelist.getNext() while serviceIterator.valid(): service, bouquet2 = self.searchNumber(1) @@ -1250,7 +1250,7 @@ class InfoBarChannelSelection: channelChange actions which open the channelSelection dialog """ def __init__(self): - #instantiate forever + # instantiate forever self.servicelist = self.session.instantiateDialog(ChannelSelection) self.servicelist2 = self.session.instantiateDialog(PiPZapSelection) self.tscallback = None @@ -1752,7 +1752,7 @@ def zapToService(self, service, bouquet=None, preview=False, zapback=False): def getBouquetServices(self, bouquet): services = [] servicelist = eServiceCenter.getInstance().list(bouquet) - if not servicelist is None: + if servicelist is not None: while True: service = servicelist.getNext() if not service.valid(): # check if end of list @@ -1808,7 +1808,7 @@ def epgClosed(self, *args): if action: action() else: - print("[InfoBarGenerics][UserDefinedButtons] Missing action method %s" % actionName) + print("[InfoBarGenerics][UserDefinedButtons] Missing action method %s" % str(args[1])) if len(args) == 6 and args[0] == "open": # open another EPG screen self.session.openWithCallback(self.epgClosed, args[1], self.zapToService, @@ -2970,12 +2970,12 @@ def getPluginName(self, name): return name def getPluginList(self): - l = [] + x = [] for p in plugins.getPlugins(where=PluginDescriptor.WHERE_EXTENSIONSMENU): args = inspect.getfullargspec(p.fnc)[0] if len(args) == 1 or len(args) == 2 and isinstance(self, InfoBarChannelSelection): - l.append(((boundFunction(self.getPluginName, p.name), boundFunction(self.runPlugin, p), lambda: True), None, p.name)) - l.sort(key=lambda e: e[2]) # sort by name + x.append(((boundFunction(self.getPluginName, p.name), boundFunction(self.runPlugin, p), lambda: True), None, p.name)) + x.sort(key=lambda e: e[2]) # sort by name return l def runPlugin(self, plugin): From 812507c75e65ef693ccca1f0ffdf1c3a916caf54 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 6 Oct 2023 20:11:38 +0200 Subject: [PATCH 035/203] [InputBox] unused import --- lib/python/Screens/InputBox.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/python/Screens/InputBox.py b/lib/python/Screens/InputBox.py index 7f4c19bc8f8..6e62fab34c8 100644 --- a/lib/python/Screens/InputBox.py +++ b/lib/python/Screens/InputBox.py @@ -4,7 +4,6 @@ from Screens.Screen import Screen from Screens.VirtualKeyBoard import VirtualKeyBoard from Components.ActionMap import HelpableNumberActionMap -from Components.config import config from Components.Input import Input from Components.Label import Label from Components.Sources.StaticText import StaticText From af4f67196aed0b5959d6f7c409c94ab431f41b90 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 00:24:16 +0200 Subject: [PATCH 036/203] E265 --- lib/python/Screens/Ci.py | 20 ++++++++++---------- lib/python/Screens/DVD.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/python/Screens/Ci.py b/lib/python/Screens/Ci.py index 0e610c48876..ccbc499c8c6 100644 --- a/lib/python/Screens/Ci.py +++ b/lib/python/Screens/Ci.py @@ -82,7 +82,7 @@ def __init__(self, session, slotid, action, handler=eDVBCI_UI.getInstance(), wai self.timer = eTimer() self.timer.callback.append(self.keyCancel) - #else the skins fails + # else the skins fails self["title"] = Label("") self["subtitle"] = Label("") self["bottom"] = Label("") @@ -94,7 +94,7 @@ def __init__(self, session, slotid, action, handler=eDVBCI_UI.getInstance(), wai "ok": self.okbuttonClick, "cancel": self.keyCancel, "menu": self.forceExit, - #for PIN + # for PIN "left": self.keyLeft, "right": self.keyRight, "1": self.keyNumberGlobal, @@ -119,14 +119,14 @@ def __init__(self, session, slotid, action, handler=eDVBCI_UI.getInstance(), wai else: self.wait_text = wait_text - if action == 2: #start MMI + if action == 2: # start MMI handler.startMMI(self.slotid) self.showWait() - elif action == 3: #mmi already there (called from infobar) + elif action == 3: # mmi already there (called from infobar) self.showScreen() def addEntry(self, list, entry): - if entry[0] == "TEXT": #handle every item (text / pin only?) + if entry[0] == "TEXT": # handle every item (text / pin only?) list.append((entry[1], ConfigNothing(), entry[2])) if entry[0] == "PIN": pinlength = entry[1] @@ -303,16 +303,16 @@ def showScreen(self): def ciStateChanged(self): do_close = False - if self.action == 0: #reset + if self.action == 0: # reset do_close = True - if self.action == 1: #init + if self.action == 1: # init do_close = True - #module still there ? + # module still there ? if self.handler.getState(self.slotid) != 2: do_close = True - #mmi session still active ? + # mmi session still active ? if self.handler.getMMIState(self.slotid) != 1: do_close = True @@ -321,7 +321,7 @@ def ciStateChanged(self): elif self.action > 1 and self.handler.availableMMI(self.slotid) == 1: self.showScreen() - #FIXME: check for mmi-session closed + # FIXME: check for mmi-session closed class CiMessageHandler: diff --git a/lib/python/Screens/DVD.py b/lib/python/Screens/DVD.py index b4f2a3e671b..8eb3d993531 100644 --- a/lib/python/Screens/DVD.py +++ b/lib/python/Screens/DVD.py @@ -203,7 +203,7 @@ def __init__(self, session, dvd_device=None, dvd_filelist=None, args=None): self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "DVDPlayerActions", { - #PLAYER ACTIONS + # PLAYER ACTIONS "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")), "toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")), "nextChapter": (self.nextChapter, _("forward to the next chapter")), From b0bc7d40f428a6e6a633ab212fc4dcb0b8ba4616 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 00:31:03 +0200 Subject: [PATCH 037/203] [InfoBarGenerics] unused import Fix name error. --- lib/python/Screens/InfoBarGenerics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index a58729e576b..e3a84cfb91d 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -20,7 +20,7 @@ from Components.Timeshift import InfoBarTimeshift from Screens.Screen import Screen -from Screens.AudioSelection import CONFIG_FILE_AV, getAVDict +from Screens.AudioSelection import getAVDict from Screens.HelpMenu import HelpableScreen from Screens import ScreenSaver from Screens.ChannelSelection import ChannelSelection, PiPZapSelection, BouquetSelector, EpgBouquetSelector, service_types_tv @@ -2976,7 +2976,7 @@ def getPluginList(self): if len(args) == 1 or len(args) == 2 and isinstance(self, InfoBarChannelSelection): x.append(((boundFunction(self.getPluginName, p.name), boundFunction(self.runPlugin, p), lambda: True), None, p.name)) x.sort(key=lambda e: e[2]) # sort by name - return l + return x def runPlugin(self, plugin): if isinstance(self, InfoBarChannelSelection): From fc3f929ce8f54c62085475e245212f1c5e67d104 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 00:42:52 +0200 Subject: [PATCH 038/203] [InputDeviceSetup] pep noise --- lib/python/Screens/InputDeviceSetup.py | 153 ++++++++++++------------- 1 file changed, 76 insertions(+), 77 deletions(-) diff --git a/lib/python/Screens/InputDeviceSetup.py b/lib/python/Screens/InputDeviceSetup.py index a777c568caa..869438844d8 100644 --- a/lib/python/Screens/InputDeviceSetup.py +++ b/lib/python/Screens/InputDeviceSetup.py @@ -50,11 +50,10 @@ def cleanup(self): def buildInterfaceList(self, device, description, type, isinputdevice=True): divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "div-h.png")) - activepng = None devicepng = None enabled = iInputDevices.getDeviceAttribute(device, 'enabled') # print("[InputDevice] device = %s, description = %s, type = %s, isinputdevice = %s, enabled = %s" % (device, description, type, isinputdevice, enabled)) - if type == None: + if type is None: devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcold-configured.png")) elif type == 'remote': if config.misc.rcused.value == 0: @@ -83,7 +82,7 @@ def buildInterfaceList(self, device, description, type, isinputdevice=True): def updateList(self): self.list = [] -# print("[InputDevice] iRcTypeControl.multipleRcSupported = {}".format(iRcTypeControl.multipleRcSupported())) + # print("[InputDevice] iRcTypeControl.multipleRcSupported = {}".format(iRcTypeControl.multipleRcSupported())) if iRcTypeControl.multipleRcSupported(): self.list.append(self.buildInterfaceList('rctype', _('Select to configure remote control type'), None, False)) @@ -91,16 +90,16 @@ def updateList(self): for x in self.devices: dev_type = iInputDevices.getDeviceAttribute(x[1], 'type') self.list.append(self.buildInterfaceList(x[1], _(x[0]), dev_type)) -# print("[InputDevice] list = {}, self.currentIndex = {}".format(self.list, self.currentIndex)) + # print("[InputDevice] list = {}, self.currentIndex = {}".format(self.list, self.currentIndex)) self["list"].setList(self.list) self["list"].setIndex(self.currentIndex) def okbuttonClick(self): selection = self["list"].getCurrent() self.currentIndex = self["list"].getIndex() -# print "[InputDevice] selection = {}".format(selection) + # print "[InputDevice] selection = {}".format(selection) if selection is not None: -# print("[InputDevice] selection[0] = {}".format(selection[0])) + # print("[InputDevice] selection[0] = {}".format(selection[0])) if selection[0] == 'rctype': self.session.open(RemoteControlType) else: @@ -129,7 +128,7 @@ def __init__(self, session, device=None): self["introduction"] = StaticText() # for generating strings into .po only - devicenames = [_("%s %s front panel") % (getMachineBrand(), getMachineName()), _("%s %s front panel") % (getMachineBrand(), getMachineName()), _("%s %s remote control (native)") % (getMachineBrand(), getMachineName()), _("%s %s advanced remote control (native)") % (getMachineBrand(), getMachineName()), _("%s %s ir keyboard") % (getMachineBrand(), getMachineName()), _("%s %s ir mouse") % (getMachineBrand(), getMachineName())] + devicenames = [_("%s %s front panel") % (getMachineBrand(), getMachineName()), _("%s %s remote control (native)") % (getMachineBrand(), getMachineName()), _("%s %s advanced remote control (native)") % (getMachineBrand(), getMachineName()), _("%s %s ir keyboard") % (getMachineBrand(), getMachineName()), _("%s %s ir mouse") % (getMachineBrand(), getMachineName())] # noqa: F841 self.createSetup() self.onLayoutFinish.append(self.layoutFinished) @@ -167,7 +166,7 @@ def createSetup(self): self["config"].invalidate(self.nameEntry) self["config"].list = self.list - if not self.selectionChanged in self["config"].onSelectionChanged: + if self.selectionChanged not in self["config"].onSelectionChanged: self["config"].onSelectionChanged.append(self.selectionChanged) self.selectionChanged() @@ -218,73 +217,73 @@ class RemoteControlType(ConfigListScreen, Screen): odinRemote = "MaraM9" rcList = [ - ("0", _("Default")), - ("3", _(odinRemote)), - ("4", _("DMM normal")), - ("5", _("et9000/et9100")), - ("6", _("DMM advanced")), - ("7", _("et5000/6000")), - ("8", _("VU+")), - ("9", _("et8000/et10000")), - ("11", _("et9200/9500/6500")), - ("13", _("et4000")), - ("14", _("XP1000")), - ("16", _("HD11/HD51/HD1100/HD1200/HD1265/HD1500/HD500C/HD530C/et7x00/et8500")), - ("17", _("XP3000")), - ("18", _("F1/F3/F4/F4-TURBO/TRIPLEX")), - ("19", _("HD2400")), - ("20", _("Zgemma Star S/2S/H1/H2")), - ("21", _("Zgemma H.S/H.2S/H.2H/H5")), - ("22", _("Zgemma i55")), - ("23", _("WWIO 4K")), - ("24", _("Axas E4HD Ultra")), - ("25", _("Zgemma H9/I55Plus old Model")), - ("26", _("Protek 4K UHD/HD61")), - ("27", _("HD60")), - ("28", _("H7/H9/H9COMBO/H10 new Model")) - ] + ("0", _("Default")), + ("3", _(odinRemote)), + ("4", _("DMM normal")), + ("5", _("et9000/et9100")), + ("6", _("DMM advanced")), + ("7", _("et5000/6000")), + ("8", _("VU+")), + ("9", _("et8000/et10000")), + ("11", _("et9200/9500/6500")), + ("13", _("et4000")), + ("14", _("XP1000")), + ("16", _("HD11/HD51/HD1100/HD1200/HD1265/HD1500/HD500C/HD530C/et7x00/et8500")), + ("17", _("XP3000")), + ("18", _("F1/F3/F4/F4-TURBO/TRIPLEX")), + ("19", _("HD2400")), + ("20", _("Zgemma Star S/2S/H1/H2")), + ("21", _("Zgemma H.S/H.2S/H.2H/H5")), + ("22", _("Zgemma i55")), + ("23", _("WWIO 4K")), + ("24", _("Axas E4HD Ultra")), + ("25", _("Zgemma H9/I55Plus old Model")), + ("26", _("Protek 4K UHD/HD61")), + ("27", _("HD60")), + ("28", _("H7/H9/H9COMBO/H10 new Model")) + ] defaultRcList = [ - ("default", 0), - ("et4000", 13), - ("et5000", 7), - ("et6000", 7), - ("et6500", 11), - ("et7x00", 16), - ("et8000", 9), - ("et8500", 16), - ("et9000", 5), - ("et9100", 5), - ("et9200", 11), - ("et9500", 11), - ("et10000", 9), - ("formuler1", 18), - ("formuler3", 18), - ("hd11", 16), - ("hd51", 16), - ("hd52", 16), - ("hd1100", 16), - ("hd1200", 16), - ("hd1265", 16), - ("hd500c", 16), - ("hd530c", 16), - ("hd2400", 19), - ("h3", 21), - ("h5", 21), - #("h7", 21),# old model - ("i55", 22), - ("bre2ze4k", 23), - ("e4hd", 24), - #("h9", 25),# old model - ("i55plus", 25), - ("protek4k", 26), - ("hd61", 26), - ("hd60", 27), - ("h7", 28), # new model - ("h9", 28), # new model - ("h9combo", 28), - ("h10", 28) - ] + ("default", 0), + ("et4000", 13), + ("et5000", 7), + ("et6000", 7), + ("et6500", 11), + ("et7x00", 16), + ("et8000", 9), + ("et8500", 16), + ("et9000", 5), + ("et9100", 5), + ("et9200", 11), + ("et9500", 11), + ("et10000", 9), + ("formuler1", 18), + ("formuler3", 18), + ("hd11", 16), + ("hd51", 16), + ("hd52", 16), + ("hd1100", 16), + ("hd1200", 16), + ("hd1265", 16), + ("hd500c", 16), + ("hd530c", 16), + ("hd2400", 19), + ("h3", 21), + ("h5", 21), + # ("h7", 21),# old model + ("i55", 22), + ("bre2ze4k", 23), + ("e4hd", 24), + # ("h9", 25),# old model + ("i55plus", 25), + ("protek4k", 26), + ("hd61", 26), + ("hd60", 27), + ("h7", 28), # new model + ("h9", 28), # new model + ("h9combo", 28), + ("h10", 28) + ] def __init__(self, session): Screen.__init__(self, session) @@ -318,12 +317,12 @@ def getDefaultRcType(self): if x[0] in boxtype or x[0] in procBoxtype: self.defaultRcType = x[1] break -# If there is none in the list, use the current value... -# -# print("[InputDevice] self.defaultRcType 1 = {}".format(self.defaultRcType)) + # If there is none in the list, use the current value... + # + # print("[InputDevice] self.defaultRcType 1 = {}".format(self.defaultRcType)) if self.defaultRcType == 0: self.defaultRcType = iRcTypeControl.readRcType() -# print("[InputDevice] self.defaultRcType 2 = {}".format(self.defaultRcType)) + # print("[InputDevice] self.defaultRcType 2 = {}".format(self.defaultRcType)) def setDefaultRcType(self): iRcTypeControl.writeRcType(self.defaultRcType) From 94dd4b93fc2ce2c5aeed7d3b39349c936ce2dfd3 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 00:49:10 +0200 Subject: [PATCH 039/203] [InstallWizard] pep noise --- lib/python/Screens/InstallWizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/InstallWizard.py b/lib/python/Screens/InstallWizard.py index 6fd8943be58..7562843a845 100644 --- a/lib/python/Screens/InstallWizard.py +++ b/lib/python/Screens/InstallWizard.py @@ -69,7 +69,7 @@ def checkNetworkLinkCB(self, retval): def createMenu(self): try: - test = self.index + test = self.index # noqa: F841 # what is this? except: return self.list = [] From ca7d7b7d786ac5e75a06d17423d76bfa51cec079 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 00:51:13 +0200 Subject: [PATCH 040/203] [Ikpg] pep noise --- lib/python/Screens/Ipkg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/python/Screens/Ipkg.py b/lib/python/Screens/Ipkg.py index 1bd5eff375b..8e9564a4986 100644 --- a/lib/python/Screens/Ipkg.py +++ b/lib/python/Screens/Ipkg.py @@ -33,7 +33,7 @@ def __init__(self, session, cmdList=None): self.activity = 0 self.activityTimer = eTimer() self.activityTimer.callback.append(self.doActivityTimer) - #self.activityTimer.start(100, False) + # self.activityTimer.start(100, False) self.ipkg = IpkgComponent() self.ipkg.addCallback(self.ipkgCallback) @@ -89,13 +89,13 @@ def ipkgCallback(self, event, param): self.slider.setValue(self.sliderPackages[param]) self.package.setText(param) self.status.setText(_("Upgrading")) - if not param in self.processed_packages: + if param not in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_INSTALL: self.package.setText(param) self.status.setText(_("Installing")) - if not param in self.processed_packages: + if param not in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_REMOVE: From 180df31ce39357b1711a15d7356b4f928d32fe61 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 00:56:16 +0200 Subject: [PATCH 041/203] [LanguageSelection] unused imports fix comments --- lib/python/Screens/LanguageSelection.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/python/Screens/LanguageSelection.py b/lib/python/Screens/LanguageSelection.py index 42b6fcd79cc..6080bd6246e 100644 --- a/lib/python/Screens/LanguageSelection.py +++ b/lib/python/Screens/LanguageSelection.py @@ -8,14 +8,11 @@ from Components.Pixmap import Pixmap from Components.Sources.List import List from Components.Sources.StaticText import StaticText -from Components.Pixmap import Pixmap -from Screens.InfoBar import InfoBar from Screens.MessageBox import MessageBox from Screens.Rc import Rc from Screens.Standby import TryQuitMainloop from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN from Tools.LoadPixmap import LoadPixmap -import gettext inWizzard = False @@ -69,7 +66,7 @@ def __init__(self, session): }, -1) def updateCache(self): -# print("[LanguageSelection] updateCache") + # print("[LanguageSelection] updateCache") self["languages"].setList([('update cache', _('Updating cache, please wait...'), None)]) self.updateTimer = eTimer() self.updateTimer.callback.append(self.startupdateCache) @@ -92,10 +89,10 @@ def selectActiveLanguage(self): def save(self): self.run() global inWizzard -# print("[LanguageSelection] save function inWizzard is %s", %inWizzard) + # print("[LanguageSelection] save function inWizzard is %s", %inWizzard) if inWizzard: inWizzard = False - #self.session.openWithCallback(self.deletelanguagesCB, MessageBox, _("Do you want to delete all other languages?"), default = False) + # self.session.openWithCallback(self.deletelanguagesCB, MessageBox, _("Do you want to delete all other languages?"), default = False) if self.oldActiveLanguage != config.osd.language.value: self.session.open(TryQuitMainloop, 3) self.close() @@ -118,11 +115,11 @@ def cancel(self): self.close() def delLang(self): -# print("[LanguageSelection] deleting language") + # print("[LanguageSelection] deleting language") curlang = config.osd.language.value lang = curlang languageList = language.getLanguageListSelection() -# print("[LanguageSelection] deleting language lang = %s, languagelist = %s", %(lang, languageList)) + # print("[LanguageSelection] deleting language lang = %s, languagelist = %s", %(lang, languageList)) for t in languageList: if curlang == t[0]: lang = t[1] @@ -139,7 +136,7 @@ def delLangCB(self, answer): curlang = config.osd.language.value lang = curlang languageList = language.getLanguageListSelection() - # print("[LanguageSelection] deleting language lang = %s, languagelist = %s", %(lang, languageList)) + # print("[LanguageSelection] deleting language lang = %s, languagelist = %s", %(lang, languageList)) for t in languageList: if curlang == t[0]: lang = t[1] @@ -154,10 +151,10 @@ def deletelanguagesCB(self, answer): language.activateLanguage(self.oldActiveLanguage) self.updateList() self.selectActiveLanguage() -# self.close() + # self.close() def run(self, justlocal=False): -# print("[LanguageSelection] updating language...") + # print("[LanguageSelection] updating language...") lang = self["languages"].getCurrent()[0] if lang == 'update cache': From b33158bab4ef30834fb5580f88e09d302acc68cd Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 00:58:25 +0200 Subject: [PATCH 042/203] [LocationBox] pep noise --- lib/python/Screens/LocationBox.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/python/Screens/LocationBox.py b/lib/python/Screens/LocationBox.py index f1b72be71c1..92ca0892e0c 100644 --- a/lib/python/Screens/LocationBox.py +++ b/lib/python/Screens/LocationBox.py @@ -518,15 +518,15 @@ def MovieLocationBox(session, text, dir, minFree=None): class TimeshiftLocationBox(LocationBox): def __init__(self, session): LocationBox.__init__( - self, - session, - text=_("Where to save temporary timeshift recordings?"), - currDir=config.usage.timeshift_path.value, - bookmarks=config.usage.allowed_timeshift_paths, - autoAdd=True, - editDir=True, - inhibitDirs=defaultInhibitDirs, - minFree=1024 # the same requirement is hardcoded in servicedvb.cpp + self, + session, + text=_("Where to save temporary timeshift recordings?"), + currDir=config.usage.timeshift_path.value, + bookmarks=config.usage.allowed_timeshift_paths, + autoAdd=True, + editDir=True, + inhibitDirs=defaultInhibitDirs, + minFree=1024 # the same requirement is hardcoded in servicedvb.cpp ) self.skinName = "LocationBox" From bbda82bb498a32d413877b515b5dc30437bfc341 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 01:01:11 +0200 Subject: [PATCH 043/203] [LogManager] pep noise --- lib/python/Screens/LogManager.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/python/Screens/LogManager.py b/lib/python/Screens/LogManager.py index 1e27343efee..27926ec4c20 100644 --- a/lib/python/Screens/LogManager.py +++ b/lib/python/Screens/LogManager.py @@ -372,13 +372,13 @@ def __init__(self, session, logpath=None): self["actions"] = ActionMap(["ChannelSelectBaseActions", "WizardActions", "DirectionActions", "MenuActions", "NumberActions", "ColorActions"], { - "ok": self.ok, - "back": self.exit, - "up": self.goUp, - "down": self.goDown, - "left": self.goLeft, - "right": self.goRight, - "0": self.doRefresh, + "ok": self.ok, + "back": self.exit, + "up": self.goUp, + "down": self.goDown, + "left": self.goLeft, + "right": self.goRight, + "0": self.doRefresh, }, -1) self.onLayoutFinish.append(self.mainlist) From 2d1e364668adb0cc0aaf6c6892738d092db13fb0 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 01:04:39 +0200 Subject: [PATCH 044/203] [MessageBox] pep noise --- lib/python/Screens/MessageBox.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index 3e28df57584..0b6bafa9942 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -224,12 +224,12 @@ def autoResize(self): self.instance.move(ePoint((getDesktop(0).size().width() - wsizex) // 2, (getDesktop(0).size().height() - wsizey) // 2)) def cancel(self): - for l in self["list"].list: - # print "[MessageBox] DEBUG: (cancel) '%s' -> '%s'" % (str(l[0]), str(l[1])) + for x in self["list"].list: + # print "[MessageBox] DEBUG: (cancel) '%s' -> '%s'" % (str(x[0]), str(x[1])) # Should we be looking at the second element to get the boolean value rather than the word? - if l[0].lower() == _('no') or l[0].lower() == _('false'): - if len(l) > 2: - l[2](None) + if x[0].lower() == _('no') or x[0].lower() == _('false'): + if len(x) > 2: + x[2](None) break # Don't close again if the MessageBox was closed in the loop if hasattr(self, "execing"): @@ -256,12 +256,12 @@ def goEntry(self, entry=None): def alwaysOK(self): if self["list"].list: - for l in self["list"].list: - # print "[MessageBox] DEBUG: (cancel) '%s' -> '%s'" % (str(l[0]), str(l[1])) + for x in self["list"].list: + # print "[MessageBox] DEBUG: (cancel) '%s' -> '%s'" % (str(x[0]), str(x[1])) # Should we be looking at the second element to get the boolean value rather than the word? - if l[0].lower() == _('yes') or l[0].lower() == _('true'): - if len(l) > 2: - self.goEntry(l) + if x[0].lower() == _('yes') or x[0].lower() == _('true'): + if len(x) > 2: + self.goEntry(x) else: self.close(True) break From b22ecd1e149dc083d9ecb9dbb8086d32d90019be Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 01:22:00 +0200 Subject: [PATCH 045/203] [skin.py] pep noise --- lib/python/skin.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/python/skin.py b/lib/python/skin.py index 4a5091df85c..d53aee14374 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -1,8 +1,7 @@ -import errno from xml.etree.cElementTree import Element, ElementTree, fromstring from enigma import addFont, eLabel, ePixmap, ePoint, eRect, eSize, eWindow, eWindowStyleManager, eWindowStyleSkinned, getDesktop, gFont, getFontFaces, gMainDC, gRGB, BT_ALPHATEST, BT_ALPHABLEND, BT_HALIGN_CENTER, BT_HALIGN_LEFT, BT_HALIGN_RIGHT, BT_KEEP_ASPECT_RATIO, BT_SCALE, BT_VALIGN_BOTTOM, BT_VALIGN_CENTER, BT_VALIGN_TOP -from os.path import basename, dirname, isfile, join +from os.path import basename, dirname, isfile from Components.config import ConfigSubsection, ConfigText, config from Components.Sources.Source import ObsoleteSource @@ -235,19 +234,19 @@ def parseCoordinate(s, e, size=0, font=None): return 0 # No test on "e" because it's already a variable if "center" in s: - center = (e - size) / 2.0 + center = (e - size) / 2.0 # noqa: F841 if "c" in s: c = e / 2.0 if "w" in s: s = s.replace("w", "*w") - w = float(font in fonts and fonts[font][3] or 0) + w = float(font in fonts and fonts[font][3] or 0) # noqa: F841 if "h" in s: s = s.replace("h", "*h") - h = float(font in fonts and fonts[font][2] or 0) + h = float(font in fonts and fonts[font][2] or 0) # noqa: F841 if "%" in s: - s = s.replace("%", "*e / 100.0") + s = s.replace("%", "*e / 100.0") # noqa: F841 if "f" in s: - f = getSkinFactor() + f = getSkinFactor() # noqa: F841 # Don't bother trying an int() conversion, # because at this point that's almost certainly # going to throw an exception. @@ -571,7 +570,7 @@ def scaleFlags(self, value): "moveRightBottom": BT_HALIGN_RIGHT | BT_VALIGN_BOTTOM }[value]) except KeyError: - raise AttribValueError("'none', 'scale', 'scaleKeepAspect', 'scaleLeftTop', 'scaleLeftCenter', 'scaleLeftBotton', 'scaleCenterTop', 'scaleCenter', 'scaleCenterBotton', 'scaleRightTop', 'scaleRightCenter', 'scaleRightBottom', 'moveLeftTop', 'moveLeftCenter', 'moveLeftBotton', 'moveCenterTop', 'moveCenter', 'moveCenterBotton', 'moveRightTop', 'moveRightCenter', 'moveRightBottom' ('Center'/'Centre'/'Middle' are equivalent)") + print("[Skin] Error: Invalid scale '%s'! Must be one of 'none', 'scale', 'scaleKeepAspect', 'scaleLeftTop', 'scaleLeftCenter', 'scaleLeftBotton', 'scaleCenterTop', 'scaleCenter', 'scaleCenterBotton', 'scaleRightTop', 'scaleRightCenter', 'scaleRightBottom', 'moveLeftTop', 'moveLeftCenter', 'moveLeftBotton', 'moveCenterTop', 'moveCenter', 'moveCenterBottom', 'moveRightTop', 'moveRightCenter', 'moveRightBottom' ('Center'/'Centre'/'Middle' are equivalent)." % value) def orientation(self, value): # Used by eSlider and eListBox. try: From ded71ea8a193dacfa3b81488daf72956d172e46a Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 01:24:45 +0200 Subject: [PATCH 046/203] [keymapparser] pep noise --- lib/python/keymapparser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/keymapparser.py b/lib/python/keymapparser.py index 1b5800f4440..af83bb80446 100644 --- a/lib/python/keymapparser.py +++ b/lib/python/keymapparser.py @@ -42,7 +42,7 @@ def parseKeys(context, filename, actionmap, device, keys): id = get_attr("id") flags = get_attr("flags") - flag_ascii_to_id = lambda x: {'m': 1, 'b': 2, 'r': 4, 'l': 8}[x] + flag_ascii_to_id = lambda x: {'m': 1, 'b': 2, 'r': 4, 'l': 8}[x] # noqa: E731 flags = sum(map(flag_ascii_to_id, flags)) @@ -51,7 +51,7 @@ def parseKeys(context, filename, actionmap, device, keys): assert flags, "[keymapparser] %s: must specify at least one flag in context %s, id '%s'" % (filename, context, id) keyid = getKeyId(id) -# print("[keymapparser] " + context + "::" + mapto + " -> " + device + "." + hex(keyid)) + # print("[keymapparser] " + context + "::" + mapto + " -> " + device + "." + hex(keyid)) actionmap.bindKey(filename, device, keyid, flags, context, mapto) addKeyBinding(filename, keyid, context, mapto, flags) From d730d95fa7635b697abbf90d3473da5f5066621c Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 01:29:54 +0200 Subject: [PATCH 047/203] [VideoWizard] unused imports --- lib/python/Screens/VideoWizard.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/python/Screens/VideoWizard.py b/lib/python/Screens/VideoWizard.py index 66f17f09857..53b1eac08f0 100644 --- a/lib/python/Screens/VideoWizard.py +++ b/lib/python/Screens/VideoWizard.py @@ -1,4 +1,3 @@ -from boxbranding import getBoxType, getMachineName, getHaveRCA, getHaveDVI, getHaveSCART, getHaveAVJACK from Screens.Wizard import WizardSummary from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc @@ -9,7 +8,7 @@ from Components.SystemInfo import SystemInfo from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_CURRENT_SKIN -from Tools.HardwareInfo import HardwareInfo +# from Tools.HardwareInfo import HardwareInfo config.misc.showtestcard = ConfigBoolean(default=False) From db006e53559c2f2e599fbc7daeb3aaf58a2bc98a Mon Sep 17 00:00:00 2001 From: openvix-build Date: Fri, 6 Oct 2023 23:31:54 +0000 Subject: [PATCH 048/203] openvix: developer 6.4.008.007 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 1b28e8a3a90..06706f2b1e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1177,3 +1177,4 @@ openvix: developer 6.4.008.003 openvix: developer 6.4.008.004 openvix: developer 6.4.008.005 openvix: developer 6.4.008.006 +openvix: developer 6.4.008.007 From 5d58121a7595d133960e3a4781d4694db4fa0919 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 09:07:43 +0200 Subject: [PATCH 049/203] [e2reactor] pep noise --- lib/python/e2reactor.py | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/lib/python/e2reactor.py b/lib/python/e2reactor.py index bb25aaef9cd..327cc548de4 100644 --- a/lib/python/e2reactor.py +++ b/lib/python/e2reactor.py @@ -16,7 +16,7 @@ # Twisted imports from twisted.python import log, failure from twisted.internet import main, posixbase, error -#from twisted.internet.pollreactor import PollReactor, poller +# from twisted.internet.pollreactor import PollReactor, poller from enigma import getApplication import six @@ -139,32 +139,24 @@ def removeAll(self, reads=reads, writes=writes, selectables=selectables): self.addReader(self.waker) return result - def doPoll(self, timeout, - reads=reads, - writes=writes, - selectables=selectables, - select=select, - log=log, - POLLIN=select.POLLIN, - POLLOUT=select.POLLOUT): + def doPoll(self, timeout, reads=reads, writes=writes, selectables=selectables, select=select, log=log, POLLIN=select.POLLIN, POLLOUT=select.POLLOUT): """Poll the poller for new events.""" if timeout is not None: timeout = int(timeout * 1000) # convert seconds to milliseconds try: - l = poller.poll(timeout) - if l is None: + x = poller.poll(timeout) + if x is None: if self.running: self.stop() - l = [] + x = [] except select.error as e: if e[0] == errno.EINTR: return - else: - raise + raise _drdw = self._doReadOrWrite - for fd, event in l: + for fd, event in x: try: selectable = selectables[fd] except KeyError: @@ -178,9 +170,9 @@ def doPoll(self, timeout, def _doReadOrWrite(self, selectable, fd, event, POLLIN, POLLOUT, log, faildict=None): if not faildict: faildict = { - error.ConnectionDone: failure.Failure(error.ConnectionDone()), - error.ConnectionLost: failure.Failure(error.ConnectionLost()) - } + error.ConnectionDone: failure.Failure(error.ConnectionDone()), + error.ConnectionLost: failure.Failure(error.ConnectionLost()) + } why = None inRead = False if event & POLL_DISCONNECTED and not (event & POLLIN): From 2e1ac39a6f9a86257c77f1960282aa72aa6c8cb0 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 09:10:03 +0200 Subject: [PATCH 050/203] [GetEcmInfo] fix indent --- lib/python/Tools/GetEcmInfo.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/python/Tools/GetEcmInfo.py b/lib/python/Tools/GetEcmInfo.py index c2ef402fe75..9a0b84da78a 100644 --- a/lib/python/Tools/GetEcmInfo.py +++ b/lib/python/Tools/GetEcmInfo.py @@ -139,19 +139,19 @@ def getText(self): source = info.get('source', None) if source: # wicardd - type 2 / mgcamd - caid = info.get('caid', None) - if caid: - info['caid'] = info['caid'][2:] - info['pid'] = info['pid'][2:] - info['provid'] = info['prov'][2:] - time = "" - for line in ecm: - if 'msec' in line: - line = line.split(' ') - if line[0]: - time = " (%ss)" % (float(line[0]) / 1000) - continue - self.textvalue = source + time + caid = info.get('caid', None) + if caid: + info['caid'] = info['caid'][2:] + info['pid'] = info['pid'][2:] + info['provid'] = info['prov'][2:] + time = "" + for line in ecm: + if 'msec' in line: + line = line.split(' ') + if line[0]: + time = " (%ss)" % (float(line[0]) / 1000) + continue + self.textvalue = source + time else: reader = info.get('reader', '') if reader: From 35c018dc1942af43b8e1cee88906fcae8a2ec0db Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 09:13:20 +0200 Subject: [PATCH 051/203] [Tools/General] unused imports --- lib/python/Tools/General.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/python/Tools/General.py b/lib/python/Tools/General.py index abe70c4b51b..de9384bc603 100644 --- a/lib/python/Tools/General.py +++ b/lib/python/Tools/General.py @@ -1,6 +1,3 @@ -from enigma import iServiceInformation, eServiceReference, eServiceCenter - - def isIPTV(service): path = service and service.getPath() return path and not path.startswith("/") and service.type in [0x1, 0x1001, 0x138A, 0x1389] From dba83958cf5b7a0118a5f667833eaa9959d10fdb Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 14:34:12 +0200 Subject: [PATCH 052/203] [StatEnigma] pep noise --- lib/python/StartEnigma.py | 124 +++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 61 deletions(-) diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index 5dc00c704b0..1e15dd8ffa2 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -1,12 +1,12 @@ from os.path import exists as osexists -import sys # don't change import +import sys # don't change import from time import localtime, strftime, time from datetime import datetime from traceback import print_exc from boxbranding import getImageArch, getImageBuild, getImageDevBuild, getImageType, getImageVersion from Tools.Profile import profile, profile_final -import Tools.RedirectOutput # Don't remove this line. It may seem to do nothing, but if removed it will break output redirection for crash logs. +import Tools.RedirectOutput # noqa: F401 # Don't remove this line. It may seem to do nothing, but if removed it will break output redirection for crash logs. import eConsoleImpl import eBaseImpl import enigma @@ -17,30 +17,32 @@ class Session: -# Session.open: -# * push current active dialog ("current_dialog") onto stack -# * call execEnd for this dialog -# * clear in_exec flag -# * hide screen -# * instantiate new dialog into "current_dialog" -# * create screens, components -# * read, apply skin -# * create GUI for screen -# * call execBegin for new dialog -# * set in_exec -# * show gui screen -# * call components' / screen's onExecBegin -# ... screen is active, until it calls "close"... -# Session.close: -# * assert in_exec -# * save return value -# * start deferred close handler ("onClose") -# * execEnd -# * clear in_exec -# * hide screen -# .. a moment later: -# Session.doClose: -# * destroy screen +""" + Session.open: + * push current active dialog ("current_dialog") onto stack + * call execEnd for this dialog + * clear in_exec flag + * hide screen + * instantiate new dialog into "current_dialog" + * create screens, components + * read, apply skin + * create GUI for screen + * call execBegin for new dialog + * set in_exec + * show gui screen + * call components' / screen's onExecBegin + ... screen is active, until it calls "close"... + Session.close: + * assert in_exec + * save return value + * start deferred close handler ("onClose") + * execEnd + * clear in_exec + * hide screen + .. a moment later: + Session.doClose: + * destroy screen +""" def __init__(self, desktop=None, summary_desktop=None, navigation=None): self.desktop = desktop @@ -303,7 +305,7 @@ def recheckVCRSb(self, configElement): self.VCRSbChanged(self.current_vcr_sb) def VCRSbChanged(self, value): - #print("vcr sb changed to", value) + # print("vcr sb changed to", value) self.current_vcr_sb = value if config.av.vcrswitch.value or value > 2: if value: @@ -357,9 +359,9 @@ def runNextScreen(session, screensToRun, *result): if not VuRecovery: profile("Init:VolumeControl") - vol = VolumeControl(session) + vol = VolumeControl(session) #noqa: F841 profile("Init:PowerKey") - power = PowerKey(session) + power = PowerKey(session) #noqa: F841 if enigma.eAVSwitch.getInstance().haveScartSwitch(): # we need session.scart to access it from within menu.xml @@ -451,7 +453,7 @@ def runNextScreen(session, screensToRun, *result): # Moving further up will break imports in config.py profile("SetupDevices") print("[StartEnigma] Initialising SetupDevices.") -from Components.SetupDevices import InitSetupDevices +from Components.SetupDevices import InitSetupDevices # noqa: E402 InitSetupDevices() if getImageArch() in ("aarch64"): @@ -461,18 +463,18 @@ def runNextScreen(session, screensToRun, *result): profile("ClientMode") print("[StartEnigma] Initialising ClientMode.") -from Components.ClientMode import InitClientMode +from Components.ClientMode import InitClientMode # noqa: E402 InitClientMode() profile("InfoBar") print("[StartEnigma] Initialising InfoBar.") -from Screens import InfoBar +from Screens import InfoBar # noqa: E402 -from Components.SystemInfo import SystemInfo # don't move this import +from Components.SystemInfo import SystemInfo # noqa: E402 # don't move this import VuRecovery = SystemInfo["HasKexecMultiboot"] and SystemInfo["MultiBootSlot"] == 0 # print("[StartEnigma] Is this VuRecovery?. Recovery = ", VuRecovery) -from Components.config import config, configfile, ConfigInteger, ConfigSelection, ConfigText, ConfigYesNo, NoSave +from Components.config import config, configfile, ConfigInteger, ConfigSelection, ConfigText, ConfigYesNo, NoSave # noqa: E402 if not VuRecovery: profile("Bouquets") print("[StartEnigma] Initialising Bouquets.") @@ -482,26 +484,26 @@ def setLoadUnlinkedUserbouquets(configElement): enigma.eDVBDB.getInstance().setLoadUnlinkedUserbouquets(configElement.value) config.misc.load_unlinked_userbouquets.addNotifier(setLoadUnlinkedUserbouquets) - if config.clientmode.enabled.value == False: + if config.clientmode.enabled.value is False: enigma.eDVBDB.getInstance().reloadBouquets() profile("ParentalControl") print("[StartEnigma] Initialising ParentalControl.") -import Components.ParentalControl +import Components.ParentalControl # noqa: E402 Components.ParentalControl.InitParentalControl() profile("LOAD:Navigation") print("[StartEnigma] Initialising Navigation.") -from Navigation import Navigation +from Navigation import Navigation # noqa: E402 profile("LOAD:skin") print("[StartEnigma] Initialising Skin.") -from skin import readSkin +from skin import readSkin # noqa: E402 profile("LOAD:Tools") print("[StartEnigma] Initialising FallbackFiles.") -from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_SKIN +from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_SKIN # noqa: E402 InitFallbackFiles() profile("config.misc") @@ -570,21 +572,21 @@ def quietEmit(self, eventDict): profile("Init:NTPSync") print("[StartEnigma] Initialising NTPSync.") -from Components.NetworkTime import AutoNTPSync +from Components.NetworkTime import AutoNTPSync # noqa: E402 AutoNTPSync() profile("LOAD:Wizard") print("[StartEnigma] Initialising Wizards.") -from Screens.StartWizard import * +from Screens.StartWizard import * # import *' used; unable to detect undefined names profile("LOAD:Plugin") print("[StartEnigma] Initialising Plugins.") # initialize autorun plugins and plugin menu entries -from Components.PluginComponent import plugins +from Components.PluginComponent import plugins # noqa: E402 -import Screens.Rc -from Tools.BoundFunction import boundFunction -from Plugins.Plugin import PluginDescriptor +import Screens.Rc # noqa: E402 +from Tools.BoundFunction import boundFunction # noqa: E402 +from Plugins.Plugin import PluginDescriptor # noqa: E402 if config.misc.firstrun.value and not osexists('/etc/install'): with open("/etc/install", "w") as f: @@ -598,9 +600,9 @@ def quietEmit(self, eventDict): profile("LOAD:ScreenGlobals") print("[StartEnigma] Initialising ScreenGlobals.") -from Screens.Globals import Globals -from Screens.SessionGlobals import SessionGlobals -from Screens.Screen import Screen, ScreenSummary +from Screens.Globals import Globals # noqa: E402 +from Screens.SessionGlobals import SessionGlobals # noqa: E402 +from Screens.Screen import Screen, ScreenSummary # noqa: E402 profile("Screen") Screen.globalScreen = Globals() @@ -618,9 +620,9 @@ def RCSelectionChanged(configelement): config.misc.RCSource.addNotifier(RCSelectionChanged, immediate_feedback=False) profile("Standby,PowerKey") -import Screens.Standby -from Screens.Menu import MainMenu, mdom -from GlobalActions import globalActionMap +import Screens.Standby # noqa: E402 +from Screens.Menu import MainMenu, mdom # noqa: E402 +from GlobalActions import globalActionMap # noqa: E402 if enigma.eAVSwitch.getInstance().haveScartSwitch(): profile("Scart") @@ -639,29 +641,29 @@ def RCSelectionChanged(configelement): profile("Init:skin") print("[StartEnigma] Initialising Skins.") -from skin import InitSkins +from skin import InitSkins # noqa: E402 InitSkins() print("[StartEnigma] Initialisation of Skins complete.") profile("InputDevice") print("[StartEnigma] Initialising InputDevice.") -from Components.InputDevice import InitInputDevices +from Components.InputDevice import InitInputDevices # noqa: E402 InitInputDevices() -import Components.InputHotplug +import Components.InputHotplug # noqa: E402 profile("UserInterface") print("[StartEnigma] Initialising UserInterface.") -from Screens.UserInterfacePositioner import InitOsd +from Screens.UserInterfacePositioner import InitOsd # noqa: E402 InitOsd() profile("AVSwitch") print("[StartEnigma] Initialising AVSwitch.") -from Components.AVSwitch import InitAVSwitch, InitiVideomodeHotplug +from Components.AVSwitch import InitAVSwitch, InitiVideomodeHotplug # noqa: E402 InitAVSwitch() InitiVideomodeHotplug() profile("EpgConfig") -from Components.EpgConfig import InitEPGConfig +from Components.EpgConfig import InitEPGConfig # noqa: E402 InitEPGConfig() if not VuRecovery: @@ -672,22 +674,22 @@ def RCSelectionChanged(configelement): profile("UsageConfig") print("[StartEnigma] Initialising UsageConfig.") -from Components.UsageConfig import InitUsageConfig +from Components.UsageConfig import InitUsageConfig # noqa: E402 InitUsageConfig() profile("TimeZones") print("[StartEnigma] Initialising Timezones.") -from Components.Timezones import InitTimeZones +from Components.Timezones import InitTimeZones # noqa: E402 InitTimeZones() profile("Init:DebugLogCheck") print("[StartEnigma] Initialising DebugLogCheck.") -from Screens.LogManager import AutoLogManager +from Screens.LogManager import AutoLogManager # noqa: E402 AutoLogManager() profile("keymapparser") print("[StartEnigma] Initialising KeymapParser.") -from keymapparser import readKeymap +from keymapparser import readKeymap # noqa: E402 readKeymap(config.usage.keymap.value) readKeymap(config.usage.keytrans.value) From dd24837450a7ff1dc1111ca18c5b7271492cbebf Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Sat, 7 Oct 2023 12:36:59 +0000 Subject: [PATCH 053/203] PEP8 double aggressive E301 ~ E306 --- lib/python/StartEnigma.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index 1e15dd8ffa2..97764a90f83 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -17,6 +17,7 @@ class Session: + """ Session.open: * push current active dialog ("current_dialog") onto stack From 3a5c0ec9c7949b755f42eb9e845925f23f4ab6dc Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 16:45:55 +0200 Subject: [PATCH 054/203] [ChoiceList] tweak https://github.com/OpenViX/enigma2/commit/473763e9e755ee2029d3b4259e263218d86826c6 --- lib/python/Components/ChoiceList.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Components/ChoiceList.py b/lib/python/Components/ChoiceList.py index fbd0cbfe083..df2498baa6e 100644 --- a/lib/python/Components/ChoiceList.py +++ b/lib/python/Components/ChoiceList.py @@ -32,9 +32,9 @@ def ChoiceEntryComponent(key=None, text=None): else: res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, "-" * 200)) else: + x, y, w, h = parameters.get("ChoicelistName", applySkinFactor(45, 2, 800, 25)) + res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, text[0])) if key: - x, y, w, h = parameters.get("ChoicelistName", applySkinFactor(45, 2, 800, 25)) - res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, text[0])) # separate the sizes definition for keybutton is=cons and the rest so there to be possibility to use different size images for different type icons iconKeyConfigName = "ChoicelistIcon" if key == "expandable": From e4f0c664f4b44d5d033316676c846e253f0f9a42 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 17:53:18 +0200 Subject: [PATCH 055/203] [MenuList] add getList/setList property --- lib/python/Components/MenuList.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/MenuList.py b/lib/python/Components/MenuList.py index a41ae82a70c..6bbf0d12d95 100644 --- a/lib/python/Components/MenuList.py +++ b/lib/python/Components/MenuList.py @@ -6,7 +6,7 @@ class MenuList(GUIComponent): def __init__(self, list, enableWrapAround=True, content=eListboxPythonStringContent): GUIComponent.__init__(self) self.l = content() - self.setList(list) + self.list = list self.onSelectionChanged = [] self.enableWrapAround = enableWrapAround @@ -36,8 +36,13 @@ def getSelectedIndex(self): return self.l.getCurrentSelectionIndex() def setList(self, list): - self.list = list - self.l.setList(self.list) + self.__list = list + self.l.setList(self.__list) + + def getList(self): + return self.__list + + list = property(getList, setList) def moveToIndex(self, idx): if self.instance is not None: From 7553fbbdfd49a938b7e799e3488dc40aebefe5ac Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 18:11:04 +0200 Subject: [PATCH 056/203] [StartEnigma] fix indent --- lib/python/StartEnigma.py | 53 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index 97764a90f83..d8853656805 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -17,33 +17,32 @@ class Session: - -""" - Session.open: - * push current active dialog ("current_dialog") onto stack - * call execEnd for this dialog - * clear in_exec flag - * hide screen - * instantiate new dialog into "current_dialog" - * create screens, components - * read, apply skin - * create GUI for screen - * call execBegin for new dialog - * set in_exec - * show gui screen - * call components' / screen's onExecBegin - ... screen is active, until it calls "close"... - Session.close: - * assert in_exec - * save return value - * start deferred close handler ("onClose") - * execEnd - * clear in_exec - * hide screen - .. a moment later: - Session.doClose: - * destroy screen -""" + """ + Session.open: + * push current active dialog ("current_dialog") onto stack + * call execEnd for this dialog + * clear in_exec flag + * hide screen + * instantiate new dialog into "current_dialog" + * create screens, components + * read, apply skin + * create GUI for screen + * call execBegin for new dialog + * set in_exec + * show gui screen + * call components' / screen's onExecBegin + ... screen is active, until it calls "close"... + Session.close: + * assert in_exec + * save return value + * start deferred close handler ("onClose") + * execEnd + * clear in_exec + * hide screen + .. a moment later: + Session.doClose: + * destroy screen + """ def __init__(self, desktop=None, summary_desktop=None, navigation=None): self.desktop = desktop From 2a427d4dd0490eadaf70a6c0190c9bb9ee7fcc82 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 18:18:27 +0200 Subject: [PATCH 057/203] [CCcamInfo] pep noise --- lib/python/Screens/CCcamInfo.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/python/Screens/CCcamInfo.py b/lib/python/Screens/CCcamInfo.py index 2e8fafaa1e4..5f1ef10136e 100644 --- a/lib/python/Screens/CCcamInfo.py +++ b/lib/python/Screens/CCcamInfo.py @@ -735,12 +735,12 @@ def showCCcamProviders(self, html): infoList = [] lines = html.split("\n") - for l in lines: - if l.__contains__('|'): + for x in lines: + if x.__contains__('|'): if firstLine: firstLine = False else: - list = l.split('|') + list = x.split('|') if len(list) > 5: caid = list[1].replace(" ", "") if caid != "": @@ -1043,10 +1043,10 @@ def readSharesCallback(self, html): totalcards += 1 # maxdown = list[6] # while maxdown.startswith(" "): - # maxdown = maxdown[1:] - # down = maxdown + # maxdown = maxdown[1:] + # down = maxdown # if int(down)>0: - # resharecards +=1 + # resharecards +=1 self.instance.setTitle("%s (%s %d) %s %s" % (_("Share View"), _("Total cards:"), totalcards, _("Hops:"), ulevel)) self["title"].setText("%s (%s %d) %s %s" % (_("Share View"), _("Total cards:"), totalcards, _("Hops:"), ulevel)) From dad3f73f63fa2b78bb89e2caf10d0de2651e29d6 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 18:24:36 +0200 Subject: [PATCH 058/203] [ChoiceBox] pep noise --- lib/python/Screens/ChoiceBox.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py index 036ddb3c6a8..5419548bc01 100644 --- a/lib/python/Screens/ChoiceBox.py +++ b/lib/python/Screens/ChoiceBox.py @@ -14,8 +14,7 @@ class ChoiceBox(Screen): - def __init__(self, session, title="", list=None, keys=None, selection=0, skin_name=None, text="", reorderConfig="", - windowTitle=None, var="", callbackList=None): + def __init__(self, session, title="", list=None, keys=None, selection=0, skin_name=None, text="", reorderConfig="", windowTitle=None, var="", callbackList=None): # list is in the format (, [,]) # callbackList is in the format (, , [,]) self.isCallbackList = bool(callbackList) From 36998e8f3d0740e24071efb283d46fb656690fb5 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 18:27:33 +0200 Subject: [PATCH 059/203] [workflows] ignore E123 --- .github/workflows/enigma2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/enigma2.yml b/.github/workflows/enigma2.yml index 33cca5b4040..70744ee0244 100644 --- a/.github/workflows/enigma2.yml +++ b/.github/workflows/enigma2.yml @@ -61,7 +61,7 @@ jobs: echo "checking locale format..." find . -type f -name "*.po" -exec msgfmt {} -o {}.mo \; echo "checking PEP8 validation..." - flake8 --builtins="_,ngettext,pgettext" --ignore=W191,W503,W504,E128,E501,E722 . --exit-zero + flake8 --builtins="_,ngettext,pgettext" --ignore=W191,W503,W504,E123,E128,E501,E722 . --exit-zero echo "check format PEP8 completed!" # PEP8 :- IGNORE CODES From 57aefb9c2ff611c83705e79d861a44349e2cbff1 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 20:01:18 +0200 Subject: [PATCH 060/203] [workflows] ignore E126 --- .github/workflows/enigma2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/enigma2.yml b/.github/workflows/enigma2.yml index 70744ee0244..d57b2e9489f 100644 --- a/.github/workflows/enigma2.yml +++ b/.github/workflows/enigma2.yml @@ -61,7 +61,7 @@ jobs: echo "checking locale format..." find . -type f -name "*.po" -exec msgfmt {} -o {}.mo \; echo "checking PEP8 validation..." - flake8 --builtins="_,ngettext,pgettext" --ignore=W191,W503,W504,E123,E128,E501,E722 . --exit-zero + flake8 --builtins="_,ngettext,pgettext" --ignore=W191,W503,W504,E123,E126,E128,E501,E722 . --exit-zero echo "check format PEP8 completed!" # PEP8 :- IGNORE CODES From 7b6a295681a9cbf5f7f7ec093ced5a01ca30a0ae Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 20:03:53 +0200 Subject: [PATCH 061/203] [InputDeviceSetup] pep noise --- lib/python/Screens/InputDeviceSetup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/Screens/InputDeviceSetup.py b/lib/python/Screens/InputDeviceSetup.py index 869438844d8..9bfae4b96fb 100644 --- a/lib/python/Screens/InputDeviceSetup.py +++ b/lib/python/Screens/InputDeviceSetup.py @@ -29,14 +29,14 @@ def __init__(self, session): self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { - "cancel": (self.close, _("Exit input device selection.")), - "ok": (self.okbuttonClick, _("Select input device.")), + "cancel": (self.close, _("Exit input device selection.")), + "ok": (self.okbuttonClick, _("Select input device.")), }, -2) self["ColorActions"] = HelpableActionMap(self, "ColorActions", { - "red": (self.close, _("Exit input device selection.")), - "green": (self.okbuttonClick, _("Select input device.")), + "red": (self.close, _("Exit input device selection.")), + "green": (self.okbuttonClick, _("Select input device.")), }, -2) self.currentIndex = 0 From 62fab4f355da9dd9f135eebf208c2826d6b49eea Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 20:06:07 +0200 Subject: [PATCH 062/203] [LogManager] mixture of tabs and spaces --- lib/python/Screens/LogManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/LogManager.py b/lib/python/Screens/LogManager.py index 27926ec4c20..cf4232b3e72 100644 --- a/lib/python/Screens/LogManager.py +++ b/lib/python/Screens/LogManager.py @@ -379,7 +379,7 @@ def __init__(self, session, logpath=None): "left": self.goLeft, "right": self.goRight, "0": self.doRefresh, - }, -1) + }, -1) self.onLayoutFinish.append(self.mainlist) def exit(self): From c58e46c61affcf724b33d1871878a1ee6c8b850a Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 20:28:40 +0200 Subject: [PATCH 063/203] [MovieSelection] pep noise --- lib/python/Screens/MovieSelection.py | 59 +++++++++++++--------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/lib/python/Screens/MovieSelection.py b/lib/python/Screens/MovieSelection.py index 3eb89f4ff18..bfd747c48ad 100644 --- a/lib/python/Screens/MovieSelection.py +++ b/lib/python/Screens/MovieSelection.py @@ -23,6 +23,7 @@ from Screens.HelpMenu import HelpableScreen from Screens.InputBox import PinInput import Screens.InfoBar +from Screens.ParentalControlSetup import ProtectedScreen from Tools import NumericalTextInput from Tools.Directories import resolveFilename, SCOPE_HDD from Tools.BoundFunction import boundFunction @@ -165,7 +166,7 @@ def canDelete(item): def createMoveList(serviceref, dest): - #normpath is to remove the trailing '/' from directories + # normpath is to remove the trailing '/' from directories src = isinstance(serviceref, str) and "%s.%s" % (serviceref, "ts" if os.path.exists("%s.ts" % serviceref) else "stream") or os.path.normpath(serviceref.getPath()) srcPath, srcName = os.path.split(src) if os.path.normpath(srcPath) == dest: @@ -191,7 +192,6 @@ def createMoveList(serviceref, dest): def moveServiceFiles(serviceref, dest, name=None, allowCopy=True): moveList = createMoveList(serviceref, dest) # Try to "atomically" move these files - movedList = [] try: # print("[MovieSelection] Moving in background...") # start with the smaller files, do the big one later. @@ -209,7 +209,6 @@ def copyServiceFiles(serviceref, dest, name=None): # current should be 'ref' type, dest a simple path string moveList = createMoveList(serviceref, dest) # Try to "atomically" move these files - movedList = [] try: # print("[MovieSelection] Copying in background...") # start with the smaller files, do the big one later. @@ -386,9 +385,6 @@ def selectionChanged(self): self["selected"].text = self.parent["config"].getCurrent()[0][0] -from Screens.ParentalControlSetup import ProtectedScreen - - class MovieContextMenu(Screen, ProtectedScreen): # Contract: On OK returns a callable object (e.g. delete) def __init__(self, session, csel, currentSelection): @@ -715,10 +711,10 @@ def __init__(self, session, selectedmovie=None, timeshiftEnabled=False): tPreview = _("Preview") tFwd = _("skip forward") + " (" + tPreview + ")" tBack = _("skip backward") + " (" + tPreview + ")" - sfwd = lambda: self.seekRelative(1, config.seek.selfdefined_46.value * 90000) - ssfwd = lambda: self.seekRelative(1, config.seek.selfdefined_79.value * 90000) - sback = lambda: self.seekRelative(-1, config.seek.selfdefined_46.value * 90000) - ssback = lambda: self.seekRelative(-1, config.seek.selfdefined_79.value * 90000) + sfwd = lambda: self.seekRelative(1, config.seek.selfdefined_46.value * 90000) # noqa: E731 + ssfwd = lambda: self.seekRelative(1, config.seek.selfdefined_79.value * 90000) # noqa: E731 + sback = lambda: self.seekRelative(-1, config.seek.selfdefined_46.value * 90000) # noqa: E731 + ssback = lambda: self.seekRelative(-1, config.seek.selfdefined_79.value * 90000) # noqa: E731 self["SeekActions"] = HelpableActionMap(self, "MovielistSeekActions", { "playpauseService": (self.preview, _("Preview")), @@ -733,10 +729,10 @@ def __init__(self, session, selectedmovie=None, timeshiftEnabled=False): self.onClose.append(self.__onClose) NavigationInstance.instance.RecordTimer.on_state_change.append(self.list.updateRecordings) self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - #iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, + # iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, - #iPlayableService.evSOF: self.__evSOF, + # iPlayableService.evSOF: self.__evSOF, }) self.onExecBegin.append(self.asciiOn) config.misc.standbyCounter.addNotifier(self.standbyCountChanged, initial_call=False) @@ -1386,11 +1382,11 @@ def __playCurrentItem(self): path = current.getPath() if current.flags & eServiceReference.mustDescent: if BlurayPlayer is not None and os.path.isdir(os.path.join(path, 'BDMV/STREAM/')): - #force a BLU-RAY extention + # force a BLU-RAY extention Screens.InfoBar.InfoBar.instance.checkTimeshiftRunning(boundFunction(self.itemSelectedCheckTimeshiftCallback, 'bluray', path)) return if os.path.isdir(os.path.join(path, 'VIDEO_TS/')) or os.path.exists(os.path.join(path, 'VIDEO_TS.IFO')): - #force a DVD extention + # force a DVD extention Screens.InfoBar.InfoBar.instance.checkTimeshiftRunning(boundFunction(self.itemSelectedCheckTimeshiftCallback, '.img', path)) return self.gotFilename(path) @@ -1488,14 +1484,13 @@ def loadLocalSettings(self): updates = pickle.load(file) file.close() self.applyConfigSettings(updates) - except IOError as e: + except IOError: # ignore fail to open errors updates = { "moviesort": config.movielist.moviesort.default, "description": config.movielist.description.default, "movieoff": config.usage.on_movie_eof.default } self.applyConfigSettings(updates) - pass # ignore fail to open errors except Exception as e: print("[MovieSelection] Failed to load settings from %s: %s" % (path, e)) else: @@ -1506,10 +1501,10 @@ def loadLocalSettings(self): } self.applyConfigSettings(updates) -# Remember this starting sort method for this dir. -# selectSortby() needs this to highlight the current sort and -# do_sort() needs it to know whence to move on. -# + # Remember this starting sort method for this dir. + # selectSortby() needs this to highlight the current sort and + # do_sort() needs it to know whence to move on. + # self["list"].current_sort = self.settings["moviesort"] def applyConfigSettings(self, updates): @@ -1533,22 +1528,22 @@ def sortBy(self, newType): print("[MovieSelection] SORTBY:", newType) if newType < MovieList.TRASHSORT_SHOWRECORD: self.settings["moviesort"] = newType -# If we are using per-directory sort methods then set it now... -# + # If we are using per-directory sort methods then set it now... + # if config.movielist.settings_per_directory.value: self.saveLocalSettings() else: -# ..otherwise, if we are setting permanent sort methods, save it, -# while, for temporary sort methods, indicate to MovieList.py to -# use a temporary sort override. -# + # ..otherwise, if we are setting permanent sort methods, save it, + # while, for temporary sort methods, indicate to MovieList.py to + # use a temporary sort override. + # if config.movielist.perm_sort_changes.value: config.movielist.moviesort.setValue(newType) config.movielist.moviesort.save() else: self["list"].temp_sort = newType self.setSortType(newType) -# Unset specific trash-sorting if other sort chosen while in Trash + # Unset specific trash-sorting if other sort chosen while in Trash if MovieList.InTrashFolder: config.usage.trashsort_deltime.value = "no" else: @@ -1597,7 +1592,7 @@ def configure(self): def configureDone(self, result): if result: self.applyConfigSettings({ - "moviesort": config.movielist.moviesort.value, + "moviesort": config.movielist.moviesort.value, "description": config.movielist.description.value, "movieoff": config.usage.on_movie_eof.value}) self.saveLocalSettings() @@ -1762,7 +1757,7 @@ def servicePinEntered(res, selItem, result): parentalControl.setSessionPinCached() parentalControl.hideBlacklist() self.gotFilename(res, selItem) - elif result == False: + elif result is False: self.session.open(MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_INFO, timeout=3) if not res: return @@ -1829,7 +1824,7 @@ def showAll(self): def showTagsN(self, tagele): if not self.tags: self.showTagWarning() - elif not tagele or (self.selected_tags and tagele.value in self.selected_tags) or not tagele.value in self.tags: + elif not tagele or (self.selected_tags and tagele.value in self.selected_tags) or tagele.value not in self.tags: self.showTagsMenu(tagele) else: self.selected_tags_ele = tagele @@ -2083,7 +2078,7 @@ def renameCallback(self, renameList, newname): else: metafile = open(meta, "r+") sid = metafile.readline() - oldtitle = metafile.readline() + oldtitle = metafile.readline() #noqa: F841 # local variable 'oldtitle' is assigned to but never used. Must be to skip a line. rest = metafile.read() metafile.seek(0) metafile.write("%s%s\n%s" % (sid, newname, rest)) @@ -2162,7 +2157,7 @@ def do_move(self): # show a more limited list of destinations, no point in showing mountpoints. title = _("Select destination for:") + " " + name bookmarks = buildMovieLocationList(includeOther=True, path=path, includeSubdirs=True, includeParentDir=True) - callback = lambda choice: self.gotMoveMovieDest(moveList, choice) + callback = lambda choice: self.gotMoveMovieDest(moveList, choice) # noqa: E731 self.session.openWithCallback(lambda choice: self.gotMovieLocation(title, callback, choice), ChoiceBox, title=title, list=bookmarks) def gotMoveMovieDest(self, moveList, choice): From 6a216774c9470fa6335ce19109731613ed1bc7ec Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 20:34:28 +0200 Subject: [PATCH 064/203] [MovieSelection] more pep noise --- lib/python/Screens/MovieSelection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/Screens/MovieSelection.py b/lib/python/Screens/MovieSelection.py index bfd747c48ad..f09cafbc7e5 100644 --- a/lib/python/Screens/MovieSelection.py +++ b/lib/python/Screens/MovieSelection.py @@ -2304,7 +2304,7 @@ def __onTimerChoiceDelete(self, delList, recList, delInfo): def __showDeleteConfirmation(self, delList, delInfo): dirCount, fileCount, subItemCount, inTrash = delInfo - callback = lambda confirmed: self.__permanentDeleteListConfirmed(delList, confirmed) + callback = lambda confirmed: self.__permanentDeleteListConfirmed(delList, confirmed) # noqa: E731 itemCount = dirCount + fileCount singleName = None if itemCount == 1: @@ -2320,7 +2320,7 @@ def __showDeleteConfirmation(self, delList, delInfo): are_you_sure = _("Do you really want to move '%s' to the trash can?") % singleName else: are_you_sure = _("Do you really want to move these %d items to the trash can?") % itemCount - callback = lambda confirmed: self.__deleteListConfirmed(delList, confirmed) + callback = lambda confirmed: self.__deleteListConfirmed(delList, confirmed) # noqa: E731 else: if itemCount == 1: are_you_sure = _("Do you really want to permanently delete '%s'?") % singleName @@ -2498,7 +2498,7 @@ def do_sort(self): index = 0 else: index += 1 - #descriptions in native languages too long... + # descriptions in native languages too long... sorttext = l_moviesort[index][2] if config.movielist.btn_red.value == "sort": self['key_red'].setText(sorttext) @@ -2516,7 +2516,7 @@ def do_sort(self): def installedMovieManagerPlugin(self): try: - from Plugins.Extensions.MovieManager.ui import MovieManager + from Plugins.Extensions.MovieManager.ui import MovieManager # noqa: F401 return True except Exception as e: print("[MovieSelection] MovieManager is not installed...", e) From bb0ab7a0b6d635072937332312f670260ee9bab6 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 20:36:34 +0200 Subject: [PATCH 065/203] [MultiBootSelector] pep noise --- lib/python/Screens/MultiBootSelector.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/python/Screens/MultiBootSelector.py b/lib/python/Screens/MultiBootSelector.py index e713e71c097..deb95d41ada 100644 --- a/lib/python/Screens/MultiBootSelector.py +++ b/lib/python/Screens/MultiBootSelector.py @@ -2,8 +2,6 @@ import tempfile import struct -from enigma import getDesktop - from boxbranding import getBoxType from Components.ActionMap import HelpableActionMap from Components.ChoiceList import ChoiceEntryComponent, ChoiceList @@ -30,7 +28,7 @@ def __init__(self, session, *args): self.tmp_dir = None self.fromInit = True usbIn = SystemInfo["HasUsbhdd"].keys() and SystemInfo["HasKexecMultiboot"] -# print("[MultiBootSelector] usbIn, SystemInfo['HasUsbhdd'], SystemInfo['HasKexecMultiboot'], SystemInfo['HasKexecUSB']", usbIn, " ", SystemInfo["HasUsbhdd"], " ", SystemInfo["HasKexecMultiboot"], " ", SystemInfo["HasKexecUSB"]) + # print("[MultiBootSelector] usbIn, SystemInfo['HasUsbhdd'], SystemInfo['HasKexecMultiboot'], SystemInfo['HasKexecUSB']", usbIn, " ", SystemInfo["HasUsbhdd"], " ", SystemInfo["HasKexecMultiboot"], " ", SystemInfo["HasKexecUSB"]) self["config"] = ChoiceList(list=[ChoiceEntryComponent(text=((_("Retrieving image slots - Please wait...")), "Queued"))]) self["description"] = StaticText(_("Press GREEN (Reboot) to switch images, YELLOW (Delete) to erase an image or BLUE (Restore) to restore all deleted images.")) self["key_red"] = StaticText(_("Add Extra USB slots") if usbIn else _("Cancel")) @@ -127,9 +125,9 @@ def deleteImageCallback(self, answer): if answer: currentSelected = self["config"].getCurrent() slot = currentSelected[0][1][0] -# print("[MultiBootSelector] delete slot = %s" % slot) + # print("[MultiBootSelector] delete slot = %s" % slot) if SystemInfo["HasKexecMultiboot"] and int(slot) < 4: -# print("[MultiBootSelector] rm -rf delete slot = %s" % slot) + # print("[MultiBootSelector] rm -rf delete slot = %s" % slot) Console().ePopen("rm -rf /boot/linuxrootfs%s" % slot) else: emptySlot(slot) @@ -147,7 +145,7 @@ def KexecMount(self): if not SystemInfo["VuUUIDSlot"]: with open("/proc/mounts", "r") as fd: xlines = fd.readlines() - # print("[MultiBootSelector] xlines", xlines) + # print("[MultiBootSelector] xlines", xlines) for hddkey in range(len(usblist)): for xline in xlines: print("[MultiBootSelector] xline, usblist", xline, " ", usblist[hddkey]) @@ -157,11 +155,11 @@ def KexecMount(self): hdd.append(xline[index:index + 4]) else: continue - # print("[MultiBootSelector] key, not in line ", usblist[hddkey], " ", xline) + # print("[MultiBootSelector] key, not in line ", usblist[hddkey], " ", xline) print("[MultiBootSelector] hdd available ", hdd) if not hdd: - self.session.open(MessageBox, _("[MultiBootSelector][add USB STARTUP slots] - No EXT4 USB attached."), MessageBox.TYPE_INFO, timeout=10) - self.cancel() + self.session.open(MessageBox, _("[MultiBootSelector][add USB STARTUP slots] - No EXT4 USB attached."), MessageBox.TYPE_INFO, timeout=10) + self.cancel() else: usb = hdd[0][0:3] free = Harddisk(usb).Totalfree() @@ -200,8 +198,8 @@ def addSTARTUPs(self, answer): def KexecMountRet(self, result=None, retval=None, extra_args=None): self.device_uuid = "UUID=" + result.split("UUID=")[1].split(" ")[0].replace('"', '') boxmodel = getBoxType()[2:] -# using UUID kernel=/linuxrootfs1/boot/zImage root=UUID="12c2025e-2969-4bd1-9e0c-da08b97d40ce" rootsubdir=linuxrootfs1 -# using dev = "kernel=/linuxrootfs4/zImage root=/dev/%s rootsubdir=linuxrootfs4" % hdd[0] # /STARTUP_4 + # using UUID kernel=/linuxrootfs1/boot/zImage root=UUID="12c2025e-2969-4bd1-9e0c-da08b97d40ce" rootsubdir=linuxrootfs1 + # using dev = "kernel=/linuxrootfs4/zImage root=/dev/%s rootsubdir=linuxrootfs4" % hdd[0] # /STARTUP_4 for usbslot in range(4, 8): STARTUP_usbslot = "kernel=%s/linuxrootfs%d/zImage root=%s rootsubdir=%s/linuxrootfs%d" % (boxmodel, usbslot, self.device_uuid, boxmodel, usbslot) # /STARTUP_ From 039f4f9badd368c5f826ba6d50632ba416e8e728 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 7 Oct 2023 21:00:44 +0200 Subject: [PATCH 066/203] [NetworkSetup] pep noise --- lib/python/Screens/NetworkSetup.py | 60 ++++++++++++++---------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/lib/python/Screens/NetworkSetup.py b/lib/python/Screens/NetworkSetup.py index 00a5efc31c5..a8310a83d46 100644 --- a/lib/python/Screens/NetworkSetup.py +++ b/lib/python/Screens/NetworkSetup.py @@ -1,9 +1,8 @@ import six -from os import system, path as os_path, remove, unlink, rename, chmod, access, X_OK +from os import system, path as os_path, unlink, rename import netifaces as ni from random import Random -from shutil import move import string import time @@ -21,11 +20,8 @@ from Components.OnlineUpdateCheck import feedsstatuscheck from Components.Pixmap import Pixmap, MultiPixmap from Components.PluginComponent import plugins -from Components.ScrollLabel import ScrollLabel from Components.Sources.StaticText import StaticText -from Components.Sources.Boolean import Boolean from Components.Sources.List import List -from Components.SystemInfo import SystemInfo from Plugins.Plugin import PluginDescriptor from Screens.HelpMenu import HelpableScreen from Screens.MessageBox import MessageBox @@ -33,7 +29,6 @@ from Screens.Setup import Setup from Screens.Standby import TryQuitMainloop from Screens.TextBox import TextBox -from Screens.VirtualKeyBoard import VirtualKeyBoard from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_SKIN from Tools.LoadPixmap import LoadPixmap @@ -180,20 +175,20 @@ def __init__(self, session): self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { - "cancel": (self.close, _("Exit network interface list")), - "ok": (self.okbuttonClick, _("Select interface")), + "cancel": (self.close, _("Exit network interface list")), + "ok": (self.okbuttonClick, _("Select interface")), }) self["ColorActions"] = HelpableActionMap(self, "ColorActions", { - "red": (self.close, _("Exit network interface list")), - "green": (self.okbuttonClick, _("Select interface")), - "blue": (self.openNetworkWizard, _("Use the network wizard to configure selected network adapter")), + "red": (self.close, _("Exit network interface list")), + "green": (self.okbuttonClick, _("Select interface")), + "blue": (self.openNetworkWizard, _("Use the network wizard to configure selected network adapter")), }) self["DefaultInterfaceAction"] = HelpableActionMap(self, "ColorActions", { - "yellow": (self.setDefaultInterface, [_("Set interface as the default Interface"), _("* Only available if more than one interface is active.")]), + "yellow": (self.setDefaultInterface, [_("Set interface as the default Interface"), _("* Only available if more than one interface is active.")]), }) self.adapters = [(iNetwork.getFriendlyAdapterName(x), x) for x in iNetwork.getAdapterList()] @@ -306,7 +301,6 @@ def updateList(self): def setDefaultInterface(self): selection = self["list"].getCurrent() - num_if = len(self.list) old_default_gw = None num_configured_if = len(iNetwork.getConfiguredAdapters()) if os_path.exists("/etc/default_gw"): @@ -510,7 +504,7 @@ def __init__(self, session, networkinfo=None, essid=None): self["ColorActions"] = HelpableActionMap(self, "ColorActions", { - "blue": (self.KeyBlue, _("Open nameserver configuration")), + "blue": (self.KeyBlue, _("Open nameserver configuration")), }) ConfigListScreen.__init__(self, [], session=session, on_change=self.newConfig, fullUI=True) @@ -855,21 +849,21 @@ def __init__(self, session, iface=None): self["WizardActions"] = HelpableActionMap(self, "WizardActions", { - "up": (self.up, _("Move up to previous entry")), - "down": (self.down, _("Move down to next entry")), - "left": (self.left, _("Move up to first entry")), - "right": (self.right, _("Move down to last entry")), + "up": (self.up, _("Move up to previous entry")), + "down": (self.down, _("Move down to next entry")), + "left": (self.left, _("Move up to first entry")), + "right": (self.right, _("Move down to last entry")), }) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { - "cancel": (self.close, _("Exit network adapter setup menu")), - "ok": (self.ok, _("Select menu entry")), + "cancel": (self.close, _("Exit network adapter setup menu")), + "ok": (self.ok, _("Select menu entry")), }) self["ColorActions"] = HelpableActionMap(self, "ColorActions", { - "red": (self.close, _("Exit network adapter setup menu")), + "red": (self.close, _("Exit network adapter setup menu")), }) self["actions"] = NumberActionMap(["WizardActions", "ShortcutActions"], @@ -899,7 +893,7 @@ def queryWirelessDevice(self, iface): else: try: system("ifconfig %s up" % iface) - wlanresponse = list(Cell.all(iface)) + wlanresponse = list(Cell.all(iface)) # what is this? local variable 'wlanresponse' is assigned to but never used except IOError as err: error_no, error_str = err.args if error_no in (errno.EOPNOTSUPP, errno.ENODEV, errno.EPERM): @@ -1056,8 +1050,8 @@ def genMainMenu(self): if os_path.exists(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkWizard/networkwizard.xml")): menu.append((_("Network wizard"), "openwizard")) -# kernel_ver = about.getKernelVersionString() -# if kernel_ver <= "3.5.0": + # kernel_ver = about.getKernelVersionString() + # if kernel_ver <= "3.5.0": menu.append((_("Network MAC settings"), "mac")) return menu @@ -1606,21 +1600,21 @@ def __init__(self, session): self["WizardActions"] = HelpableActionMap(self, "WizardActions", { - "up": (self.up, _("Move up to previous entry")), - "down": (self.down, _("Move down to next entry")), - "left": (self.left, _("Move up to first entry")), - "right": (self.right, _("Move down to last entry")), + "up": (self.up, _("Move up to previous entry")), + "down": (self.down, _("Move down to next entry")), + "left": (self.left, _("Move up to first entry")), + "right": (self.right, _("Move down to last entry")), }) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { - "cancel": (self.close, _("Exit mounts setup menu")), - "ok": (self.ok, _("Select menu entry")), + "cancel": (self.close, _("Exit mounts setup menu")), + "ok": (self.ok, _("Select menu entry")), }) self["ColorActions"] = HelpableActionMap(self, "ColorActions", { - "red": (self.close, _("Exit networkadapter setup menu")), + "red": (self.close, _("Exit networkadapter setup menu")), }) self["actions"] = NumberActionMap(["WizardActions", "ShortcutActions"], @@ -2272,7 +2266,7 @@ def updateService(self): self["key_green"].setText(_("Start")) status_summary = self["status"].text + " " + self["labstop"].text - #self.my_nabina_state = False + # self.my_nabina_state = False if fileExists("/etc/inadyn.conf"): f = open("/etc/inadyn.conf", "r") for line in f.readlines(): @@ -2596,7 +2590,7 @@ def updateList(self, ret=None): self.ushare_xbox = NoSave(ConfigYesNo(default=True)) self.ushare_ps3 = NoSave(ConfigYesNo(default=True)) # looks like dead code - #self.ushare_system = NoSave(ConfigSelection(default = "dyndns@dyndns.org", choices = [("dyndns@dyndns.org", "dyndns@dyndns.org"), ("statdns@dyndns.org", "statdns@dyndns.org"), ("custom@dyndns.org", "custom@dyndns.org")])) + # self.ushare_system = NoSave(ConfigSelection(default = "dyndns@dyndns.org", choices = [("dyndns@dyndns.org", "dyndns@dyndns.org"), ("statdns@dyndns.org", "statdns@dyndns.org"), ("custom@dyndns.org", "custom@dyndns.org")])) if fileExists("/etc/ushare.conf"): f = open("/etc/ushare.conf", "r") From 23e37d427c215a5656b3cf561603abcbff14b294 Mon Sep 17 00:00:00 2001 From: Twol Date: Sun, 8 Oct 2023 18:21:54 +0200 Subject: [PATCH 067/203] [StartWizard] - config.misc.rcused is same for all E2 receivers --- lib/python/Screens/StartWizard.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/python/Screens/StartWizard.py b/lib/python/Screens/StartWizard.py index ffe5cd9b300..e83562b3b5c 100644 --- a/lib/python/Screens/StartWizard.py +++ b/lib/python/Screens/StartWizard.py @@ -29,11 +29,7 @@ def __init__(self, session, silent=True, showSteps=False, neededTag=None): self["wizard"] = Pixmap() def markDone(self): - # setup remote control, all stb have same settings except dm8000 which uses a different settings - if getBoxType() == 'dm8000': - config.misc.rcused.value = 0 - else: - config.misc.rcused.value = 1 + config.misc.rcused.value = 1 # setup remote control, all stb have same settings config.misc.rcused.save() config.misc.firstrun.value = 0 From 26d28cca3b1e1703fac220c7bcc193cc405a55b2 Mon Sep 17 00:00:00 2001 From: Orlandoxx <95180049+Orlandoxx@users.noreply.github.com> Date: Mon, 9 Oct 2023 07:33:08 +0300 Subject: [PATCH 068/203] Updated fi.po Fixed 'Reset' --- po/fi.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/fi.po b/po/fi.po index 5c5b278a47b..09ed4dfbf8b 100644 --- a/po/fi.po +++ b/po/fi.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: enigma2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-27 23:35+0000\n" -"PO-Revision-Date: 2023-10-01 09:51+0300\n" +"PO-Revision-Date: 2023-10-09 07:28+0300\n" "Last-Translator: Orlandox\n" "Language-Team: timoj/Kojo/Samzam/Orlandox\n" "Language: fi\n" @@ -10877,7 +10877,7 @@ msgid "Reserved for future use" msgstr "Varattu tulevaa käyttöä varten" msgid "Reset" -msgstr "Käynnistä CA-moduuli uudelleen" +msgstr "Nollaa" msgid "Reset and renumerate title names" msgstr "Nollaa ja uudelleenjärjestä otsikot" @@ -13537,7 +13537,7 @@ msgstr "" "Suomenkielinen käännös: timoj, Kojo, Samzam, Orlandox\n" "\n" "Ylläpito : Orlandox\n" -"01.10.2023\n" +"09.10.2023\n" "http://www.huoltovalikko.com" msgid "TS file is too large for ISO9660 level 1!" From 5455b313792798a29f3cc45813062d5f111aa360 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Mon, 9 Oct 2023 13:07:22 +0300 Subject: [PATCH 069/203] - added possibility in skin to define string type parameters --- lib/python/skin.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/python/skin.py b/lib/python/skin.py index d53aee14374..2d15d043484 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -28,6 +28,7 @@ menus = {} # Dictionary of images associated with menu entries. menuicons = {} # Dictionary of icons associated with menu items. parameters = {} # Dictionary of skin parameters used to modify code behavior. +stringparameters = {} # Dictionary that contains string type parameters for use in screens setups = {} # Dictionary of images associated with setup menus. switchPixmap = {} # Dictionary of switch images. scrollbarStyle = None # When set, a dictionary of scrollbar styles @@ -64,7 +65,7 @@ def InitSkins(booting=True): global currentPrimarySkin, currentDisplaySkin - global domScreens, colors, BodyFont, fonts, menus, menuicons, parameters, setups, switchPixmap, scrollbarStyle, windowStyles, xres, yres + global domScreens, colors, BodyFont, fonts, menus, menuicons, parameters, stringparameters, setups, switchPixmap, scrollbarStyle, windowStyles, xres, yres # Reset skin dictionaries. We can reload skins without a restart # Make sure we keep the original dictionaries as many modules now import skin globals explicitly domScreens.clear() @@ -76,6 +77,7 @@ def InitSkins(booting=True): menus.clear() menuicons.clear() parameters.clear() + stringparameters.clear() setups.clear() switchPixmap.clear() scrollbarStyle = None @@ -764,7 +766,7 @@ def reloadWindowStyles(): def loadSingleSkinData(desktop, screenID, domSkin, pathSkin, scope=SCOPE_CURRENT_SKIN): """Loads skin data like colors, windowstyle etc.""" assert domSkin.tag == "skin", "root element in skin must be 'skin'!" - global colors, fonts, menus, menuicons, parameters, setups, switchPixmap, scrollbarStyle, xres, yres + global colors, fonts, menus, menuicons, parameters, stringparameters, setups, switchPixmap, scrollbarStyle, xres, yres for tag in domSkin.findall("output"): scrnID = int(tag.attrib.get("id", GUI_SKIN_ID)) if scrnID == GUI_SKIN_ID: @@ -937,6 +939,15 @@ def loadResolvedPixmap(filename): # print("[Skin] DEBUG: Menu key='%s', image='%s'." % (key, image)) else: raise SkinError("Tag 'menuicon' needs key and image, got key='%s' and image='%s'" % (key, image)) + for tag in domSkin.findall("stringparameters"): + for stringparam in tag.findall("stringparam"): + key = stringparam.attrib.get("key") + value = stringparam.attrib.get("value") + if key and value: + stringparameters[key] = value + # print("[Skin] DEBUG: Menu key='%s', image='%s'." % (key, image)) + else: + raise SkinError("Tag 'stringparameters' needs key and value, got key='%s' and value='%s'" % (key, value)) for tag in domSkin.findall("setups"): for setup in tag.findall("setup"): key = setup.attrib.get("key") From 72787355645ee58ff338fab75a7e9d00f87b6db3 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Mon, 9 Oct 2023 13:08:31 +0300 Subject: [PATCH 070/203] - added possibility in convertors to output info in one single string with separator character --- lib/python/Components/Converter/Converter.py | 8 ++ lib/python/Components/Converter/EventName.py | 26 +++++- lib/python/Components/Converter/MovieInfo.py | 23 ++++- .../Components/Converter/ServiceName.py | 93 +++++++++++++++---- 4 files changed, 129 insertions(+), 21 deletions(-) diff --git a/lib/python/Components/Converter/Converter.py b/lib/python/Components/Converter/Converter.py index 69835469e2b..fc3212b985f 100644 --- a/lib/python/Components/Converter/Converter.py +++ b/lib/python/Components/Converter/Converter.py @@ -5,9 +5,17 @@ class Converter(Element): def __init__(self, arguments): Element.__init__(self) self.converter_arguments = arguments + self.separatorChar = "" def __repr__(self): return str(type(self)) + "(" + self.converter_arguments + ")" def handleCommand(self, cmd): self.source.handleCommand(cmd) + + def appendToStringWithSeparator(self, str, part): + if str == "": + str = part + else: + str = str + " " + self.separatorChar + " " + part + return str diff --git a/lib/python/Components/Converter/EventName.py b/lib/python/Components/Converter/EventName.py index 7a69ca536ed..7c6f29d4d59 100644 --- a/lib/python/Components/Converter/EventName.py +++ b/lib/python/Components/Converter/EventName.py @@ -5,7 +5,7 @@ from Components.Converter.genre import getGenreStringSub from Components.config import config from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN -from time import localtime, mktime, strftime +from time import time, localtime, mktime, strftime class ETSIClassifications(dict): @@ -106,6 +106,8 @@ class EventName(Converter): RATINGCOUNTRY = 32 RATINGICON = 33 + FORMAT_STRING = 34 + KEYWORDS = { # Arguments... "Name": ("type", NAME), @@ -162,6 +164,12 @@ def __init__(self, type): parse = "," type.replace(";", parse) # Some builds use ";" as a separator, most use ",". args = [arg.strip() for arg in type.split(parse)] + self.parts = args + + if len(self.parts) > 1: + self.type = self.FORMAT_STRING + self.separatorChar = self.parts[0] + for arg in args: name, value = self.KEYWORDS.get(arg, ("Error", None)) if name == "Error": @@ -307,6 +315,22 @@ def getText(self): rating = event.getParentalData() if rating: return rating.getCountryCode().upper() + elif self.type == self.FORMAT_STRING: + begin = event.getBeginTime() + end = begin + event.getDuration() + now = int(time()) + t_start = localtime(begin) + t_end = localtime(end) + if begin <= now <= end: + duration = end - now + duration_str = "+%d min" % (duration / 60) + else: + duration = event.getDuration() + duration_str = "%d min" % (duration / 60) + start_time_str = "%2d:%02d" % (t_start.tm_hour, t_start.tm_min) + end_time_str = "%2d:%02d" % (t_end.tm_hour, t_end.tm_min) + res_str = "%s - %s %s %s" % (start_time_str, end_time_str, self.separator, duration_str) + return res_str return "" text = property(getText) diff --git a/lib/python/Components/Converter/MovieInfo.py b/lib/python/Components/Converter/MovieInfo.py index 02163a7efc0..1eca908ec6b 100644 --- a/lib/python/Components/Converter/MovieInfo.py +++ b/lib/python/Components/Converter/MovieInfo.py @@ -5,6 +5,7 @@ from Components.Converter.Converter import Converter from Components.Element import cached from Components.Harddisk import bytesToHumanReadable +from time import localtime, strftime # Handle any invalid utf8 in a description to avoid crash when # displaying it. @@ -28,6 +29,7 @@ class MovieInfo(Converter): MOVIE_REC_FILESIZE = 4 # filesize of recording MOVIE_FULL_DESCRIPTION = 5 # combination of short and long description when available MOVIE_NAME = 6 # recording name + FORMAT_STRING = 6 # it is formatted string based on parameter and with defined separator KEYWORDS = { # Arguments... @@ -46,6 +48,7 @@ class MovieInfo(Converter): } def __init__(self, type): + Converter.__init__(self, type) self.textEvent = None self.type = None self.separator = "\n" @@ -54,6 +57,12 @@ def __init__(self, type): parse = "," type.replace(";", parse) # Some builds use ";" as a separator, most use ",". args = [arg.strip() for arg in type.split(parse)] + + self.parts = args + if len(self.parts) > 1: + self.type = self.FORMAT_STRING + self.separatorChar = self.parts[0] + for arg in args: name, value = self.KEYWORDS.get(arg, ("Error", None)) if name == "Error": @@ -63,7 +72,6 @@ def __init__(self, type): if ((name == "Error") or (type is None)): print("[MovieInfo] Valid arguments are: ShortDescription|MetaDescription|FullDescription|RecordServiceName|RecordServiceRef|FileSize.") print("[MovieInfo] Valid options for descriptions are: Separated|NotSeparated|Trimmed|NotTrimmed.") - Converter.__init__(self, type) def destroy(self): Converter.destroy(self) @@ -133,6 +141,19 @@ def getText(self): return info.getInfoString(service, iServiceInformation.sServiceref) elif self.type == self.MOVIE_REC_FILESIZE: return self.getFileSize(service, info) + elif self.type == self.FORMAT_STRING: + timeCreate = strftime("%A %d %b %Y", localtime(info.getInfo(service, iServiceInformation.sTimeCreate))) + duration = "%d min" % (info.getLength(service) / 60) + filesize = "%d MB" % (info.getInfoObject(service, iServiceInformation.sFileSize) / (1024*1024)) + res_str = "" + for x in self.parts[1:]: + if x == "TIMECREATED" and timeCreate != '': + res_str = self.appendToStringWithSeparator(res_str, timeCreate) + if x == "DURATION" and duration != '': + res_str = self.appendToStringWithSeparator(res_str, duration) + if x == "FILESIZE" and filesize != '': + res_str = self.appendToStringWithSeparator(res_str, filesize) + return res_str return "" def __getCollectionDescription(self, service): diff --git a/lib/python/Components/Converter/ServiceName.py b/lib/python/Components/Converter/ServiceName.py index 4ecc715446f..76109409dbd 100644 --- a/lib/python/Components/Converter/ServiceName.py +++ b/lib/python/Components/Converter/ServiceName.py @@ -15,25 +15,31 @@ class ServiceName(Converter): PROVIDER = 3 REFERENCE = 4 EDITREFERENCE = 5 + FORMAT_STRING = 6 def __init__(self, type): Converter.__init__(self, type) self.epgQuery = eEPGCache.getInstance().lookupEventTime self.mode = "" - if ';' in type: - type, self.mode = type.split(';') - if type == "Provider": - self.type = self.PROVIDER - elif type == "Reference": - self.type = self.REFERENCE - elif type == "EditReference": - self.type = self.EDITREFERENCE - elif type == "NameOnly": - self.type = self.NAME_ONLY - elif type == "NameAndEvent": - self.type = self.NAME_EVENT + self.parts = type.split(",") + if len(self.parts) > 1: + self.type = self.FORMAT_STRING + self.separatorChar = self.parts[0] else: - self.type = self.NAME + if ';' in type: + type, self.mode = type.split(';') + if type == "Provider": + self.type = self.PROVIDER + elif type == "Reference": + self.type = self.REFERENCE + elif type == "EditReference": + self.type = self.EDITREFERENCE + elif type == "NameOnly": + self.type = self.NAME_ONLY + elif type == "NameAndEvent": + self.type = self.NAME_EVENT + else: + self.type = self.NAME @cached def getText(self): @@ -49,10 +55,7 @@ def getText(self): return "" if self.type == self.NAME or self.type == self.NAME_ONLY or self.type == self.NAME_EVENT: - name = service and info.getName(service) - if name is None: - name = info.getName() - name = name.replace('\xc2\x86', '').replace('\xc2\x87', '').replace('_', ' ') + name = self.getName(service, info) if self.type == self.NAME_EVENT: act_event = info and info.getEvent(0) if not act_event and info: @@ -64,7 +67,7 @@ def getText(self): return "%s - %s" % (name, act_event.getEventName()) elif self.type != self.NAME_ONLY and config.usage.show_infobar_channel_number.value and hasattr(self.source, "serviceref") and self.source.serviceref and '0:0:0:0:0:0:0:0:0' not in self.source.serviceref.toString(): numservice = self.source.serviceref - num = numservice and numservice.getChannelNum() or None + num = self.getNumber(numservice, info) if num is not None: return str(num) + ' ' + name else: @@ -72,7 +75,7 @@ def getText(self): else: return name elif self.type == self.PROVIDER: - return info.getInfoString(iServiceInformation.sProvider) + return self.getProvider(service, info) elif self.type == self.REFERENCE or self.type == self.EDITREFERENCE and hasattr(self.source, "editmode") and self.source.editmode: if not service: refstr = info.getInfoString(iServiceInformation.sServiceref) @@ -86,9 +89,61 @@ def getText(self): if nref: service = nref return service.toString() + elif self.type == self.FORMAT_STRING: + name = self.getName(service, info) + num = self.getNumber(service, info) + provider = self.getProvider(service, info) + orbpos = self.getOrbitalPos(service, info) + res_str = "" + for x in self.parts[1:]: + if x == "NUMBER" and num != '': + res_str = self.appendToStringWithSeparator(res_str, num) + if x == "NAME" and name != '': + res_str = self.appendToStringWithSeparator(res_str, name) + if x == "ORBPOS" and orbpos != '': + res_str = self.appendToStringWithSeparator(res_str, orbpos) + if x == "PROVIDER" and provider is not None and provider != '': + res_str = self.appendToStringWithSeparator(res_str, provider) + return res_str text = property(getText) def changed(self, what): if what[0] != self.CHANGED_SPECIFIC or what[1] in (iPlayableService.evStart,): Converter.changed(self, what) + + def getName(self, ref, info): + name = ref and info.getName(ref) + if name is None: + name = info.getName() + return name.replace('\xc2\x86', '').replace('\xc2\x87', '').replace('_', ' ') + + def getNumber(self, ref, info): + if not ref: + ref = eServiceReference(info.getInfoString(iServiceInformation.sServiceref)) + num = ref and ref.getChannelNum() or None + if num is not None: + num = str(num) + return num + + def getProvider(self, ref, info): + if ref: + return info.getInfoString(ref, iServiceInformation.sProvider) + return info.getInfoString(iServiceInformation.sProvider) + + def getOrbitalPos(self, ref, info): + orbitalpos = "" + if ref: + tp_data = info.getInfoObject(ref, iServiceInformation.sTransponderData) + else: + tp_data = info.getInfoObject(iServiceInformation.sTransponderData) + if tp_data is not None: + try: + position = tp_data["orbital_position"] + if position > 1800: # west + orbitalpos = "%.1f " %(float(3600 - position)/10) + _("W") + else: + orbitalpos = "%.1f " %(float(position)/10) + _("E") + except: + pass + return orbitalpos From 70814265359ef3ea0a54026ef8f9c39e45566671 Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Mon, 9 Oct 2023 10:27:52 +0000 Subject: [PATCH 071/203] PEP8 double aggressive E22, E224, E241, E242 and E27 --- lib/python/Components/Converter/MovieInfo.py | 4 ++-- lib/python/Components/Converter/ServiceName.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/Components/Converter/MovieInfo.py b/lib/python/Components/Converter/MovieInfo.py index 1eca908ec6b..6d099c1c702 100644 --- a/lib/python/Components/Converter/MovieInfo.py +++ b/lib/python/Components/Converter/MovieInfo.py @@ -142,9 +142,9 @@ def getText(self): elif self.type == self.MOVIE_REC_FILESIZE: return self.getFileSize(service, info) elif self.type == self.FORMAT_STRING: - timeCreate = strftime("%A %d %b %Y", localtime(info.getInfo(service, iServiceInformation.sTimeCreate))) + timeCreate = strftime("%A %d %b %Y", localtime(info.getInfo(service, iServiceInformation.sTimeCreate))) duration = "%d min" % (info.getLength(service) / 60) - filesize = "%d MB" % (info.getInfoObject(service, iServiceInformation.sFileSize) / (1024*1024)) + filesize = "%d MB" % (info.getInfoObject(service, iServiceInformation.sFileSize) / (1024 * 1024)) res_str = "" for x in self.parts[1:]: if x == "TIMECREATED" and timeCreate != '': diff --git a/lib/python/Components/Converter/ServiceName.py b/lib/python/Components/Converter/ServiceName.py index 76109409dbd..8012723bbf1 100644 --- a/lib/python/Components/Converter/ServiceName.py +++ b/lib/python/Components/Converter/ServiceName.py @@ -141,9 +141,9 @@ def getOrbitalPos(self, ref, info): try: position = tp_data["orbital_position"] if position > 1800: # west - orbitalpos = "%.1f " %(float(3600 - position)/10) + _("W") + orbitalpos = "%.1f " % (float(3600 - position) / 10) + _("W") else: - orbitalpos = "%.1f " %(float(position)/10) + _("E") + orbitalpos = "%.1f " % (float(position) / 10) + _("E") except: pass return orbitalpos From 26a734a03c6b6f3c519f01d412b135059c8b7d48 Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Mon, 9 Oct 2023 10:28:15 +0000 Subject: [PATCH 072/203] PEP8 double aggressive E225 ~ E228 and E231 --- lib/python/Components/Converter/MovieInfo.py | 2 +- lib/python/Components/Converter/ServiceName.py | 2 +- lib/python/skin.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/Converter/MovieInfo.py b/lib/python/Components/Converter/MovieInfo.py index 6d099c1c702..3512f4559e4 100644 --- a/lib/python/Components/Converter/MovieInfo.py +++ b/lib/python/Components/Converter/MovieInfo.py @@ -29,7 +29,7 @@ class MovieInfo(Converter): MOVIE_REC_FILESIZE = 4 # filesize of recording MOVIE_FULL_DESCRIPTION = 5 # combination of short and long description when available MOVIE_NAME = 6 # recording name - FORMAT_STRING = 6 # it is formatted string based on parameter and with defined separator + FORMAT_STRING = 6 # it is formatted string based on parameter and with defined separator KEYWORDS = { # Arguments... diff --git a/lib/python/Components/Converter/ServiceName.py b/lib/python/Components/Converter/ServiceName.py index 8012723bbf1..d0e4af90c46 100644 --- a/lib/python/Components/Converter/ServiceName.py +++ b/lib/python/Components/Converter/ServiceName.py @@ -140,7 +140,7 @@ def getOrbitalPos(self, ref, info): if tp_data is not None: try: position = tp_data["orbital_position"] - if position > 1800: # west + if position > 1800: # west orbitalpos = "%.1f " % (float(3600 - position) / 10) + _("W") else: orbitalpos = "%.1f " % (float(position) / 10) + _("E") diff --git a/lib/python/skin.py b/lib/python/skin.py index 2d15d043484..5c555240f1b 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -28,7 +28,7 @@ menus = {} # Dictionary of images associated with menu entries. menuicons = {} # Dictionary of icons associated with menu items. parameters = {} # Dictionary of skin parameters used to modify code behavior. -stringparameters = {} # Dictionary that contains string type parameters for use in screens +stringparameters = {} # Dictionary that contains string type parameters for use in screens setups = {} # Dictionary of images associated with setup menus. switchPixmap = {} # Dictionary of switch images. scrollbarStyle = None # When set, a dictionary of scrollbar styles From c4bfd059d9de92ec60ff96e3191e8cb24680c3dd Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Mon, 9 Oct 2023 10:28:45 +0000 Subject: [PATCH 073/203] PEP8 double aggressive W291 ~ W293 and W391 --- lib/python/Components/Converter/EventName.py | 2 +- lib/python/Components/Converter/MovieInfo.py | 2 +- lib/python/Components/Converter/ServiceName.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/python/Components/Converter/EventName.py b/lib/python/Components/Converter/EventName.py index 7c6f29d4d59..006f5436227 100644 --- a/lib/python/Components/Converter/EventName.py +++ b/lib/python/Components/Converter/EventName.py @@ -328,7 +328,7 @@ def getText(self): duration = event.getDuration() duration_str = "%d min" % (duration / 60) start_time_str = "%2d:%02d" % (t_start.tm_hour, t_start.tm_min) - end_time_str = "%2d:%02d" % (t_end.tm_hour, t_end.tm_min) + end_time_str = "%2d:%02d" % (t_end.tm_hour, t_end.tm_min) res_str = "%s - %s %s %s" % (start_time_str, end_time_str, self.separator, duration_str) return res_str return "" diff --git a/lib/python/Components/Converter/MovieInfo.py b/lib/python/Components/Converter/MovieInfo.py index 3512f4559e4..c742a1acd58 100644 --- a/lib/python/Components/Converter/MovieInfo.py +++ b/lib/python/Components/Converter/MovieInfo.py @@ -143,7 +143,7 @@ def getText(self): return self.getFileSize(service, info) elif self.type == self.FORMAT_STRING: timeCreate = strftime("%A %d %b %Y", localtime(info.getInfo(service, iServiceInformation.sTimeCreate))) - duration = "%d min" % (info.getLength(service) / 60) + duration = "%d min" % (info.getLength(service) / 60) filesize = "%d MB" % (info.getInfoObject(service, iServiceInformation.sFileSize) / (1024 * 1024)) res_str = "" for x in self.parts[1:]: diff --git a/lib/python/Components/Converter/ServiceName.py b/lib/python/Components/Converter/ServiceName.py index d0e4af90c46..dd4ded3b83e 100644 --- a/lib/python/Components/Converter/ServiceName.py +++ b/lib/python/Components/Converter/ServiceName.py @@ -117,7 +117,7 @@ def getName(self, ref, info): if name is None: name = info.getName() return name.replace('\xc2\x86', '').replace('\xc2\x87', '').replace('_', ' ') - + def getNumber(self, ref, info): if not ref: ref = eServiceReference(info.getInfoString(iServiceInformation.sServiceref)) @@ -125,12 +125,12 @@ def getNumber(self, ref, info): if num is not None: num = str(num) return num - + def getProvider(self, ref, info): if ref: return info.getInfoString(ref, iServiceInformation.sProvider) return info.getInfoString(iServiceInformation.sProvider) - + def getOrbitalPos(self, ref, info): orbitalpos = "" if ref: From 3071837bf4e99b323bfecbd58ac2d54a00f4c9b5 Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 9 Oct 2023 13:24:00 +0200 Subject: [PATCH 074/203] [ServiceName] remove what looks like dead code --- lib/python/Components/Converter/ServiceName.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/python/Components/Converter/ServiceName.py b/lib/python/Components/Converter/ServiceName.py index dd4ded3b83e..0896d5e9892 100644 --- a/lib/python/Components/Converter/ServiceName.py +++ b/lib/python/Components/Converter/ServiceName.py @@ -20,14 +20,11 @@ class ServiceName(Converter): def __init__(self, type): Converter.__init__(self, type) self.epgQuery = eEPGCache.getInstance().lookupEventTime - self.mode = "" self.parts = type.split(",") if len(self.parts) > 1: self.type = self.FORMAT_STRING self.separatorChar = self.parts[0] else: - if ';' in type: - type, self.mode = type.split(';') if type == "Provider": self.type = self.PROVIDER elif type == "Reference": From 9eda36e348df1243ea347e20c8dba6816d94f634 Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 9 Oct 2023 15:43:33 +0200 Subject: [PATCH 075/203] [skin] revert: https://github.com/OpenViX/enigma2/commit/5455b313792798a29f3cc45813062d5f111aa360 ... not required, for reasons discussed with the author. --- lib/python/skin.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/python/skin.py b/lib/python/skin.py index 5c555240f1b..d53aee14374 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -28,7 +28,6 @@ menus = {} # Dictionary of images associated with menu entries. menuicons = {} # Dictionary of icons associated with menu items. parameters = {} # Dictionary of skin parameters used to modify code behavior. -stringparameters = {} # Dictionary that contains string type parameters for use in screens setups = {} # Dictionary of images associated with setup menus. switchPixmap = {} # Dictionary of switch images. scrollbarStyle = None # When set, a dictionary of scrollbar styles @@ -65,7 +64,7 @@ def InitSkins(booting=True): global currentPrimarySkin, currentDisplaySkin - global domScreens, colors, BodyFont, fonts, menus, menuicons, parameters, stringparameters, setups, switchPixmap, scrollbarStyle, windowStyles, xres, yres + global domScreens, colors, BodyFont, fonts, menus, menuicons, parameters, setups, switchPixmap, scrollbarStyle, windowStyles, xres, yres # Reset skin dictionaries. We can reload skins without a restart # Make sure we keep the original dictionaries as many modules now import skin globals explicitly domScreens.clear() @@ -77,7 +76,6 @@ def InitSkins(booting=True): menus.clear() menuicons.clear() parameters.clear() - stringparameters.clear() setups.clear() switchPixmap.clear() scrollbarStyle = None @@ -766,7 +764,7 @@ def reloadWindowStyles(): def loadSingleSkinData(desktop, screenID, domSkin, pathSkin, scope=SCOPE_CURRENT_SKIN): """Loads skin data like colors, windowstyle etc.""" assert domSkin.tag == "skin", "root element in skin must be 'skin'!" - global colors, fonts, menus, menuicons, parameters, stringparameters, setups, switchPixmap, scrollbarStyle, xres, yres + global colors, fonts, menus, menuicons, parameters, setups, switchPixmap, scrollbarStyle, xres, yres for tag in domSkin.findall("output"): scrnID = int(tag.attrib.get("id", GUI_SKIN_ID)) if scrnID == GUI_SKIN_ID: @@ -939,15 +937,6 @@ def loadResolvedPixmap(filename): # print("[Skin] DEBUG: Menu key='%s', image='%s'." % (key, image)) else: raise SkinError("Tag 'menuicon' needs key and image, got key='%s' and image='%s'" % (key, image)) - for tag in domSkin.findall("stringparameters"): - for stringparam in tag.findall("stringparam"): - key = stringparam.attrib.get("key") - value = stringparam.attrib.get("value") - if key and value: - stringparameters[key] = value - # print("[Skin] DEBUG: Menu key='%s', image='%s'." % (key, image)) - else: - raise SkinError("Tag 'stringparameters' needs key and value, got key='%s' and value='%s'" % (key, value)) for tag in domSkin.findall("setups"): for setup in tag.findall("setup"): key = setup.attrib.get("key") From 6bb52803d141e970d0eccccf401e7cb0c396552a Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 9 Oct 2023 16:23:13 +0200 Subject: [PATCH 076/203] [MovieSelection] add custom title separator --- lib/python/Screens/MovieSelection.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/python/Screens/MovieSelection.py b/lib/python/Screens/MovieSelection.py index f09cafbc7e5..6e282d13560 100644 --- a/lib/python/Screens/MovieSelection.py +++ b/lib/python/Screens/MovieSelection.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from Screens.Screen import Screen from Components.Button import Button from Components.ActionMap import HelpableActionMap, ActionMap, HelpableNumberActionMap @@ -32,6 +33,7 @@ import NavigationInstance import RecordTimer from ServiceReference import ServiceReference +from skin import parameters from enigma import eServiceReference, eServiceCenter, eTimer, eSize, iPlayableService, iServiceInformation, getPrevAsciiCode, eRCInput import os @@ -1712,14 +1714,7 @@ def reloadWithDelay(self): self.loadLocalSettings() self["list"].reload(self.current_ref, self.selected_tags, self.collectionName) self.updateTags() - title = "" - if config.usage.setup_level.index >= 2: # expert+ - title += config.movielist.last_videodir.value - if self.selected_tags: - title += " - " + ','.join(self.selected_tags) - if self.collectionName: - title += ": %s" % self.collectionName - self.setTitle(title) + self.updateTitle() self.displayMovieOffStatus() self.displaySortStatus() if not (self.reload_sel and self["list"].moveTo(self.reload_sel)): @@ -1738,6 +1733,17 @@ def reloadWithDelay(self): self.callLater(self.preview) self.callLater(self.enablePathSelect) + def updateTitle(self): + separatorChar = parameters.get("MovieSelectionTitleSeparatorChar", "-") + title = [] + if config.usage.setup_level.index >= 2: # expert+ + title.append(config.movielist.last_videodir.value) + if self.selected_tags: + title.append(','.join(self.selected_tags)) + if self.collectionName: + title.append(self.collectionName) + self.title = (" %s " % separatorChar).join(title) + def enablePathSelect(self): self.pathselectEnabled = True From 1cbbce344788390b47f3aac94d4e08ade19e7675 Mon Sep 17 00:00:00 2001 From: openvix-build Date: Mon, 9 Oct 2023 14:57:20 +0000 Subject: [PATCH 077/203] openvix: developer 6.4.008.008 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 06706f2b1e9..295d76ea8f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1178,3 +1178,4 @@ openvix: developer 6.4.008.004 openvix: developer 6.4.008.005 openvix: developer 6.4.008.006 openvix: developer 6.4.008.007 +openvix: developer 6.4.008.008 From a99b67a54bef79173452e6946703c85008965df0 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Wed, 11 Oct 2023 09:59:43 +0300 Subject: [PATCH 078/203] - make possible to get max text width among the items of Listbox based lists (an provide it in python) --- lib/gui/elistbox.h | 2 ++ lib/gui/elistboxcontent.cpp | 12 +++++++++++- lib/gui/elistboxcontent.h | 2 ++ lib/python/Screens/MessageBox.py | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/gui/elistbox.h b/lib/gui/elistbox.h index ea9917dc8d9..5157830900b 100644 --- a/lib/gui/elistbox.h +++ b/lib/gui/elistbox.h @@ -53,6 +53,7 @@ class iListboxContent: public iObject virtual int getItemHeight()=0; virtual int getItemWidth() { return -1; } virtual int getOrientation() { return 1; } + virtual int getMaxItemTextWidth() { return 1; } eListbox *m_listbox; #endif @@ -184,6 +185,7 @@ class eListbox: public eWidget int getScrollbarWidth() { return m_scrollbar_width; } int getScrollbarHeight() { return m_scrollbar_height; } + int getMaxItemTextWidth() { return m_content->getMaxItemTextWidth(); } #ifndef SWIG struct eListboxStyle *getLocalStyle(void); diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 77daf8388ec..123562e66a2 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -52,7 +52,7 @@ int iListboxContent::currentCursorSelectable() DEFINE_REF(eListboxPythonStringContent); eListboxPythonStringContent::eListboxPythonStringContent() - :m_cursor(0), m_saved_cursor(0), m_itemheight(25), m_itemwidth(25), m_orientation(1) + :m_cursor(0), m_saved_cursor(0), m_itemheight(25), m_itemwidth(25), m_max_text_width(0), m_orientation(1) { } @@ -275,6 +275,16 @@ void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, flags |= gPainter::RT_HALIGN_BLOCK; } + eRect textRect = eRect(text_offset, m_itemsize); + + ePtr para = new eTextPara(textRect); + para->setFont(fnt); + para->renderString(string); + int textWidth = para->getBoundBox().width(); + if (textWidth > m_max_text_width) { + m_max_text_width = textWidth; + } + painter.renderText(eRect(text_offset, m_itemsize), string, flags, border_color, border_size); } diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h index 291e4194ba9..9a22b629f25 100644 --- a/lib/gui/elistboxcontent.h +++ b/lib/gui/elistboxcontent.h @@ -20,6 +20,7 @@ class eListboxPythonStringContent: public virtual iListboxContent void invalidateEntry(int index); void invalidate(); eSize getItemSize() { return m_itemsize; } + int getMaxItemTextWidth() { return m_max_text_width; } #ifndef SWIG protected: void cursorHome(); @@ -53,6 +54,7 @@ class eListboxPythonStringContent: public virtual iListboxContent ePtr m_font; int m_itemheight; int m_itemwidth; + int m_max_text_width; int m_orientation; #endif }; diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index 0b6bafa9942..def32e1546f 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -291,3 +291,6 @@ def move(self, direction): def __repr__(self): return "%s(%s)" % (str(type(self)), self.text) + + def getListWidth(self): + return self["list"].instance.getMaxItemTextWidth() From b85bf050cd430071ea621f4513cee934742bb430 Mon Sep 17 00:00:00 2001 From: openvix-build Date: Wed, 11 Oct 2023 07:24:16 +0000 Subject: [PATCH 079/203] openvix: developer 6.4.008.009 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 295d76ea8f0..695f9a32ea8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1179,3 +1179,4 @@ openvix: developer 6.4.008.005 openvix: developer 6.4.008.006 openvix: developer 6.4.008.007 openvix: developer 6.4.008.008 +openvix: developer 6.4.008.009 From 00556456920cc00cf984c5891412d00c5555e12f Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Wed, 11 Oct 2023 07:27:27 +0000 Subject: [PATCH 080/203] PEP8 double aggressive W291 ~ W293 and W391 --- lib/python/Screens/MessageBox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index def32e1546f..ca217ac2a37 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -291,6 +291,6 @@ def move(self, direction): def __repr__(self): return "%s(%s)" % (str(type(self)), self.text) - + def getListWidth(self): return self["list"].instance.getMaxItemTextWidth() From 56ed3e8ab2370527b84e3eb8bf76e38a1dee952b Mon Sep 17 00:00:00 2001 From: Huevos Date: Wed, 11 Oct 2023 10:56:05 +0200 Subject: [PATCH 081/203] [ServiceName] fix crash < 2115.9412> [Skin] Error in screen 'SecondInfoBar', TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'! < 2115.9457> Traceback (most recent call last): < 2115.9459> File "/usr/lib/enigma2/python/skin.py", line 1379, in readSkin < 2115.9460> File "/usr/lib/enigma2/python/skin.py", line 1335, in processScreen < 2115.9461> File "/usr/lib/enigma2/python/skin.py", line 1270, in processWidget < 2115.9461> File "/usr/lib/enigma2/python/Components/Renderer/Label.py", line 16, in connect < 2115.9462> File "/usr/lib/enigma2/python/Components/Element.py", line 61, in connect < 2115.9462> File "/usr/lib/enigma2/python/Components/Element.py", line 58, in connectUpstream < 2115.9463> File "/usr/lib/enigma2/python/Components/Renderer/Label.py", line 25, in changed < 2115.9463> File "/usr/lib/enigma2/python/Components/Element.py", line 16, in wrapper < 2115.9463> File "/usr/lib/enigma2/python/Components/Converter/ServiceName.py", line 99, in getText < 2115.9464> File "/usr/lib/enigma2/python/Components/Converter/Converter.py", line 20, in appendToStringWithSeparator < 2115.9465> TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' --- lib/python/Components/Converter/ServiceName.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/python/Components/Converter/ServiceName.py b/lib/python/Components/Converter/ServiceName.py index 0896d5e9892..5bc706463d2 100644 --- a/lib/python/Components/Converter/ServiceName.py +++ b/lib/python/Components/Converter/ServiceName.py @@ -88,7 +88,8 @@ def getText(self): return service.toString() elif self.type == self.FORMAT_STRING: name = self.getName(service, info) - num = self.getNumber(service, info) + numservice = self.source.serviceref + num = self.getNumber(numservice, info) provider = self.getProvider(service, info) orbpos = self.getOrbitalPos(service, info) res_str = "" From 546119c2a96c1dcd31599973cd8b4d8317b217d0 Mon Sep 17 00:00:00 2001 From: Twol Date: Wed, 11 Oct 2023 15:28:26 +0200 Subject: [PATCH 082/203] [ebase] when sf8008 handles IPTV services, polls return endless unhandled POLLERR/HUP/NVAL messages - so issue return and null debug message --- lib/base/ebase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/base/ebase.cpp b/lib/base/ebase.cpp index c1ab135b3c0..a4b6d5b5f3e 100644 --- a/lib/base/ebase.cpp +++ b/lib/base/ebase.cpp @@ -100,7 +100,7 @@ void eTimer::changeInterval(long msek) else bActive=true; // then activate Timer - interval = msek; // set new Interval + interval = msek; // set new Interval nextActivation += interval; // calc nextActivation context.addTimer(this); // add Timer to context TimerList @@ -272,7 +272,8 @@ int eMainloop::processOneEvent(long user_timeout, PyObject **res, ePyObject addi m_inActivate = 0; } if (pfd[i].revents & (POLLERR|POLLHUP|POLLNVAL)) - eTrace("[eMainloop::processOneEvent] unhandled POLLERR/HUP/NVAL for fd %d(%d)", pfd[i].fd, pfd[i].revents); + return_reason = 1; +/* eTrace("[eMainloop::processOneEvent] unhandled POLLERR/HUP/NVAL for fd %d(%d)", pfd[i].fd, pfd[i].revents); */ } } for (; i < fdcount; ++i) From ac84823782bf2a2d99745350ba362bbe38d5e6e2 Mon Sep 17 00:00:00 2001 From: Huevos Date: Wed, 11 Oct 2023 21:45:21 +0200 Subject: [PATCH 083/203] Revert: https://github.com/OpenViX/enigma2/commit/a99b67a54bef79173452e6946703c85008965df0 --- lib/gui/elistbox.h | 2 -- lib/gui/elistboxcontent.cpp | 12 +----------- lib/gui/elistboxcontent.h | 2 -- lib/python/Screens/MessageBox.py | 3 --- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/lib/gui/elistbox.h b/lib/gui/elistbox.h index 5157830900b..ea9917dc8d9 100644 --- a/lib/gui/elistbox.h +++ b/lib/gui/elistbox.h @@ -53,7 +53,6 @@ class iListboxContent: public iObject virtual int getItemHeight()=0; virtual int getItemWidth() { return -1; } virtual int getOrientation() { return 1; } - virtual int getMaxItemTextWidth() { return 1; } eListbox *m_listbox; #endif @@ -185,7 +184,6 @@ class eListbox: public eWidget int getScrollbarWidth() { return m_scrollbar_width; } int getScrollbarHeight() { return m_scrollbar_height; } - int getMaxItemTextWidth() { return m_content->getMaxItemTextWidth(); } #ifndef SWIG struct eListboxStyle *getLocalStyle(void); diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 123562e66a2..77daf8388ec 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -52,7 +52,7 @@ int iListboxContent::currentCursorSelectable() DEFINE_REF(eListboxPythonStringContent); eListboxPythonStringContent::eListboxPythonStringContent() - :m_cursor(0), m_saved_cursor(0), m_itemheight(25), m_itemwidth(25), m_max_text_width(0), m_orientation(1) + :m_cursor(0), m_saved_cursor(0), m_itemheight(25), m_itemwidth(25), m_orientation(1) { } @@ -275,16 +275,6 @@ void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, flags |= gPainter::RT_HALIGN_BLOCK; } - eRect textRect = eRect(text_offset, m_itemsize); - - ePtr para = new eTextPara(textRect); - para->setFont(fnt); - para->renderString(string); - int textWidth = para->getBoundBox().width(); - if (textWidth > m_max_text_width) { - m_max_text_width = textWidth; - } - painter.renderText(eRect(text_offset, m_itemsize), string, flags, border_color, border_size); } diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h index 9a22b629f25..291e4194ba9 100644 --- a/lib/gui/elistboxcontent.h +++ b/lib/gui/elistboxcontent.h @@ -20,7 +20,6 @@ class eListboxPythonStringContent: public virtual iListboxContent void invalidateEntry(int index); void invalidate(); eSize getItemSize() { return m_itemsize; } - int getMaxItemTextWidth() { return m_max_text_width; } #ifndef SWIG protected: void cursorHome(); @@ -54,7 +53,6 @@ class eListboxPythonStringContent: public virtual iListboxContent ePtr m_font; int m_itemheight; int m_itemwidth; - int m_max_text_width; int m_orientation; #endif }; diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index ca217ac2a37..0b6bafa9942 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -291,6 +291,3 @@ def move(self, direction): def __repr__(self): return "%s(%s)" % (str(type(self)), self.text) - - def getListWidth(self): - return self["list"].instance.getMaxItemTextWidth() From f992732f8d319ce1e115fdbd01a82e29c601f65b Mon Sep 17 00:00:00 2001 From: Huevos Date: Wed, 11 Oct 2023 21:39:14 +0200 Subject: [PATCH 084/203] [elistbox] Add method to calculate max list-item width for use in MessageBox Author: @DimitarCC --- lib/gui/elistbox.h | 2 ++ lib/gui/elistboxcontent.cpp | 42 +++++++++++++++++++++++++++++--- lib/gui/elistboxcontent.h | 2 ++ lib/python/Screens/MessageBox.py | 3 +++ 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/lib/gui/elistbox.h b/lib/gui/elistbox.h index ea9917dc8d9..5157830900b 100644 --- a/lib/gui/elistbox.h +++ b/lib/gui/elistbox.h @@ -53,6 +53,7 @@ class iListboxContent: public iObject virtual int getItemHeight()=0; virtual int getItemWidth() { return -1; } virtual int getOrientation() { return 1; } + virtual int getMaxItemTextWidth() { return 1; } eListbox *m_listbox; #endif @@ -184,6 +185,7 @@ class eListbox: public eWidget int getScrollbarWidth() { return m_scrollbar_width; } int getScrollbarHeight() { return m_scrollbar_height; } + int getMaxItemTextWidth() { return m_content->getMaxItemTextWidth(); } #ifndef SWIG struct eListboxStyle *getLocalStyle(void); diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 77daf8388ec..9af0b3b5368 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -52,7 +52,7 @@ int iListboxContent::currentCursorSelectable() DEFINE_REF(eListboxPythonStringContent); eListboxPythonStringContent::eListboxPythonStringContent() - :m_cursor(0), m_saved_cursor(0), m_itemheight(25), m_itemwidth(25), m_orientation(1) + :m_cursor(0), m_saved_cursor(0), m_itemheight(25), m_itemwidth(25), m_max_text_width(0), m_orientation(1) { } @@ -138,6 +138,43 @@ void eListboxPythonStringContent::setSize(const eSize &size) m_itemsize = size; } +int eListboxPythonStringContent::getMaxItemTextWidth() +{ + ePtr fnt; + eListboxStyle *local_style = 0; + int m_text_offset = 1; + if (m_listbox) + local_style = m_listbox->getLocalStyle(); + if (local_style) { + fnt = local_style->m_font; + m_text_offset = local_style->m_text_offset.x(); + } + if (!fnt) fnt = new gFont("Regular", 20); + + for (int i = 0; i < size(); i++) + { + ePyObject item = PyList_GET_ITEM(m_list, i); + if (PyTuple_Check(item)) + { + item = PyTuple_GET_ITEM(item, 0); + } + if (item != Py_None) { + const char *string = PyUnicode_Check(item) ? PyUnicode_AsUTF8(item) : ""; + eRect textRect = eRect(0,0, 8000, 100); + + ePtr para = new eTextPara(textRect); + para->setFont(fnt); + para->renderString(string); + int textWidth = para->getBoundBox().width(); + if (textWidth > m_max_text_width) { + m_max_text_width = textWidth; + } + } + } + + return m_max_text_width + (m_text_offset*2); +} + void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected) { ePtr fnt; @@ -275,8 +312,7 @@ void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, flags |= gPainter::RT_HALIGN_BLOCK; } - painter.renderText(eRect(text_offset, m_itemsize), - string, flags, border_color, border_size); + painter.renderText(eRect(text_offset, m_itemsize), string, flags, border_color, border_size); } } diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h index 291e4194ba9..60daf87160d 100644 --- a/lib/gui/elistboxcontent.h +++ b/lib/gui/elistboxcontent.h @@ -20,6 +20,7 @@ class eListboxPythonStringContent: public virtual iListboxContent void invalidateEntry(int index); void invalidate(); eSize getItemSize() { return m_itemsize; } + int getMaxItemTextWidth(); #ifndef SWIG protected: void cursorHome(); @@ -53,6 +54,7 @@ class eListboxPythonStringContent: public virtual iListboxContent ePtr m_font; int m_itemheight; int m_itemwidth; + int m_max_text_width; int m_orientation; #endif }; diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index 0b6bafa9942..def32e1546f 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -291,3 +291,6 @@ def move(self, direction): def __repr__(self): return "%s(%s)" % (str(type(self)), self.text) + + def getListWidth(self): + return self["list"].instance.getMaxItemTextWidth() From d83b22d166a7181169165b88c4134a0cb373c525 Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Wed, 11 Oct 2023 19:49:27 +0000 Subject: [PATCH 085/203] PEP8 double aggressive W291 ~ W293 and W391 --- lib/python/Screens/MessageBox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index def32e1546f..ca217ac2a37 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -291,6 +291,6 @@ def move(self, direction): def __repr__(self): return "%s(%s)" % (str(type(self)), self.text) - + def getListWidth(self): return self["list"].instance.getMaxItemTextWidth() From bb969e9f2529dd5a9bd650a482dcecc78ab8f5cd Mon Sep 17 00:00:00 2001 From: Huevos Date: Thu, 12 Oct 2023 23:37:17 +0200 Subject: [PATCH 086/203] [ServiceName] protect against NoneType objects --- lib/python/Components/Converter/ServiceName.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/Components/Converter/ServiceName.py b/lib/python/Components/Converter/ServiceName.py index 5bc706463d2..a664579609e 100644 --- a/lib/python/Components/Converter/ServiceName.py +++ b/lib/python/Components/Converter/ServiceName.py @@ -94,13 +94,13 @@ def getText(self): orbpos = self.getOrbitalPos(service, info) res_str = "" for x in self.parts[1:]: - if x == "NUMBER" and num != '': + if x == "NUMBER" and num: res_str = self.appendToStringWithSeparator(res_str, num) - if x == "NAME" and name != '': + if x == "NAME" and name: res_str = self.appendToStringWithSeparator(res_str, name) - if x == "ORBPOS" and orbpos != '': + if x == "ORBPOS" and orbpos: res_str = self.appendToStringWithSeparator(res_str, orbpos) - if x == "PROVIDER" and provider is not None and provider != '': + if x == "PROVIDER" and provider: res_str = self.appendToStringWithSeparator(res_str, provider) return res_str From b401943561ec6331c0fabb7dda6c6c8fc49eb90f Mon Sep 17 00:00:00 2001 From: Huevos Date: Thu, 12 Oct 2023 23:38:49 +0200 Subject: [PATCH 087/203] [TimerList] add onSelectionChanged for handling callbacks --- lib/python/Components/TimerList.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index 744434a5453..8ff1b61d9b8 100644 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -135,6 +135,7 @@ def addPicon(): def __init__(self, list): GUIComponent.__init__(self) + self.onSelectionChanged = [] self.l = eListboxPythonMultiContent() self.l.setBuildFunc(self.buildTimerEntry) self.serviceNameFont = gFont("Regular", 20) @@ -205,10 +206,19 @@ def getCurrent(self): GUI_WIDGET = eListbox def postWidgetCreate(self, instance): + instance.selectionChanged.get().append(self.selectionChanged) instance.setContent(self.l) self.instance = instance instance.setWrapAround(True) + def preWidgetRemove(self, instance): + instance.selectionChanged.get().remove(self.selectionChanged) + instance.setContent(None) + + def selectionChanged(self): + for x in self.onSelectionChanged: + x() + def moveToIndex(self, index): self.instance.moveSelectionTo(index) From 1e4e8499b5b05972bcfdff7e94437430fe2295a0 Mon Sep 17 00:00:00 2001 From: AbuBaniaz Date: Sat, 24 Jun 2023 16:20:54 +0100 Subject: [PATCH 088/203] [Satconfig] Reword "Connected" Include wording that is in hint text --- lib/python/Screens/Satconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index e19aa632ef0..8b94f69d8c4 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -444,7 +444,7 @@ def fillListWithAdvancedSatEntrys(self, Sat): if self.nim.isFBCLink(): if not self.nimConfig.advanced.unicableconnected.value: self.nimConfig.advanced.unicableconnected.value = True - self.advancedConnected = getConfigListEntry(self.indent % _("Connected"), self.nimConfig.advanced.unicableconnected, _("Select 'yes' if this tuner is connected to the SCR device through another tuner, otherwise select 'no'.")) + self.advancedConnected = getConfigListEntry(self.indent % _("Connected through another tuner"), self.nimConfig.advanced.unicableconnected, _("Select 'yes' if this tuner is connected to the SCR device through another tuner, otherwise select 'no'.")) self.list.append(self.advancedConnected) if self.nimConfig.advanced.unicableconnected.value: self.nimConfig.advanced.unicableconnectedTo.setChoices(choices) From c4becfcac47c9586bf3eef70fcb8268598d2a8c0 Mon Sep 17 00:00:00 2001 From: Orlandoxx <95180049+Orlandoxx@users.noreply.github.com> Date: Fri, 13 Oct 2023 07:33:36 +0300 Subject: [PATCH 089/203] Updated fi.po Added [Satconfig] "Connected" reword. --- po/fi.po | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/po/fi.po b/po/fi.po index 09ed4dfbf8b..6490b32ceee 100644 --- a/po/fi.po +++ b/po/fi.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: enigma2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-27 23:35+0000\n" -"PO-Revision-Date: 2023-10-09 07:28+0300\n" +"PO-Revision-Date: 2023-10-13 07:29+0300\n" "Last-Translator: Orlandox\n" "Language-Team: timoj/Kojo/Samzam/Orlandox\n" "Language: fi\n" @@ -3914,6 +3914,9 @@ msgstr "Yhdistä WLAN-verkkoon" msgid "Connected" msgstr "Yhdistetty:" +msgid "Connected through another tuner" +msgstr "Yhdistetty toisen virittimen kautta" + msgid "Connected clients" msgstr "Kytkeytyneet asiakkaat" @@ -13537,7 +13540,7 @@ msgstr "" "Suomenkielinen käännös: timoj, Kojo, Samzam, Orlandox\n" "\n" "Ylläpito : Orlandox\n" -"09.10.2023\n" +"13.10.2023\n" "http://www.huoltovalikko.com" msgid "TS file is too large for ISO9660 level 1!" From 979cd7dbd311b2943c8fa64bb1d01602b9ac88c9 Mon Sep 17 00:00:00 2001 From: jbleyel Date: Fri, 13 Oct 2023 08:39:30 +0200 Subject: [PATCH 090/203] [LCD] fix dumplcd for 32 Bit --- lib/gdi/lcd.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/gdi/lcd.cpp b/lib/gdi/lcd.cpp index 0437adfe864..f86e2d644f3 100644 --- a/lib/gdi/lcd.cpp +++ b/lib/gdi/lcd.cpp @@ -265,7 +265,7 @@ void eDBoxLCD::dumpLCD2PNG(void) int lcd_width = res.width(); int lcd_hight = res.height(); ePtr pixmap32; - pixmap32 = new gPixmap(eSize(lcd_width, lcd_hight), 32, gPixmap::accelAuto); + pixmap32 = new gPixmap(eSize(lcd_width, lcd_hight), 32, gPixmap::accelNever); const uint8_t *srcptr = (uint8_t*)_buffer; uint8_t *dstptr=(uint8_t*)pixmap32->surface->data; @@ -326,11 +326,9 @@ void eDBoxLCD::dumpLCD2PNG(void) break; case 32: { - srcptr += _stride/4; - dstptr += pixmap32->surface->stride/4; for (int y = lcd_hight; y != 0; --y) { - memcpy(dstptr, srcptr, lcd_width*bpp); + memcpy(dstptr, srcptr, lcd_width*pixmap32->surface->bypp); srcptr += _stride; dstptr += pixmap32->surface->stride; } From ab4f43b570d0b486695b42ee1581791265c7aaa5 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Fri, 13 Oct 2023 10:58:42 +0300 Subject: [PATCH 091/203] - fixed some missing events in various lists --- lib/python/Components/MenuList.py | 1 + lib/python/Components/TimerList.py | 1 + lib/python/Screens/PluginBrowser.py | 8 ++++---- lib/python/Screens/TimerEdit.py | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/python/Components/MenuList.py b/lib/python/Components/MenuList.py index 6bbf0d12d95..a80df3c7062 100644 --- a/lib/python/Components/MenuList.py +++ b/lib/python/Components/MenuList.py @@ -38,6 +38,7 @@ def getSelectedIndex(self): def setList(self, list): self.__list = list self.l.setList(self.__list) + self.selectionChanged() def getList(self): return self.__list diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index 8ff1b61d9b8..2a48bb3f4bb 100644 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -143,6 +143,7 @@ def __init__(self, list): self.eventNameFont = gFont("Regular", 18) self.l.setList(list) + self.selectionChanged() self.itemHeight = 50 self.rowSplit = 25 self.iconMargin = 4 diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py index 76acae13206..86b203202d3 100644 --- a/lib/python/Screens/PluginBrowser.py +++ b/lib/python/Screens/PluginBrowser.py @@ -213,7 +213,7 @@ def move(self, direction): self.list = [self.list[-1]] + self.list[:-1] else: self.list[currentIndex], self.list[swapIndex] = self.list[swapIndex], self.list[currentIndex] - self["list"].l.setList(self.list) + self["list"].setList(self.list) if direction == 1: self["list"].down() else: @@ -233,7 +233,7 @@ def updateList(self): self.list.append(PluginEntryComponent(plugin[0], self.listWidth)) pluginlist.remove(plugin[0]) self.list = self.list + [PluginEntryComponent(plugin, self.listWidth) for plugin in pluginlist] - self["list"].l.setList(self.list) + self["list"].setList(self.list) def delete(self): config.misc.pluginbrowser.po.value = False @@ -630,7 +630,7 @@ def updateList(self): if self.type == self.UPDATE: self.list = updatedlist - self["list"].l.setList(updatedlist) + self["list"].setList(updatedlist) return for x in self.pluginlist: @@ -679,7 +679,7 @@ def updateList(self): else: updatedlist.append(PluginCategoryComponent(x, expandableIcon, self.listWidth)) self.list = updatedlist - self["list"].l.setList(updatedlist) + self["list"].setList(updatedlist) language.addCallback(languageChanged) diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 23cf6c6ef0e..e8de1df15ea 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -75,6 +75,7 @@ def __init__(self, session, selectItem=None): def onCreate(self): self.fillTimerList() self["timerlist"].l.setList(self.list) + self["timerlist"].selectionChanged() if self.selectItem is not None: (event, service) = self.selectItem From 3a5220a3ee84c744a10d2b4d50ac1629f6c913f9 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Fri, 13 Oct 2023 11:34:08 +0300 Subject: [PATCH 092/203] fix timerlist pager functionality --- lib/python/Components/TimerList.py | 8 +++++++- lib/python/Screens/TimerEdit.py | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index 2a48bb3f4bb..7e2d3ac0057 100644 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -143,7 +143,7 @@ def __init__(self, list): self.eventNameFont = gFont("Regular", 18) self.l.setList(list) - self.selectionChanged() + self.listCount = len(list) self.itemHeight = 50 self.rowSplit = 25 self.iconMargin = 4 @@ -198,6 +198,7 @@ def satPosLeft(value): self.l.setFont(0, self.serviceNameFont) self.l.setFont(1, self.font) self.l.setFont(2, self.eventNameFont) + self.selectionChanged() return GUIComponent.applySkin(self, desktop, parent) def getCurrent(self): @@ -206,6 +207,11 @@ def getCurrent(self): GUI_WIDGET = eListbox + def setList(self, list): + self.l.setList(list) + self.listCount = len(list) + self.selectionChanged() + def postWidgetCreate(self, instance): instance.selectionChanged.get().append(self.selectionChanged) instance.setContent(self.l) diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index e8de1df15ea..40531e5f9ac 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -74,8 +74,7 @@ def __init__(self, session, selectItem=None): def onCreate(self): self.fillTimerList() - self["timerlist"].l.setList(self.list) - self["timerlist"].selectionChanged() + self["timerlist"].setList(self.list) if self.selectItem is not None: (event, service) = self.selectItem From 53b839ecddbc626059e047123a87cc3cb37b9be1 Mon Sep 17 00:00:00 2001 From: openvix-build Date: Fri, 13 Oct 2023 08:52:34 +0000 Subject: [PATCH 093/203] openvix: developer 6.4.008.010 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 695f9a32ea8..6eb7f35d9c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1180,3 +1180,4 @@ openvix: developer 6.4.008.006 openvix: developer 6.4.008.007 openvix: developer 6.4.008.008 openvix: developer 6.4.008.009 +openvix: developer 6.4.008.010 From 46a69f09f64ac895b2652679c10f3bb211c6410f Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 13 Oct 2023 11:31:55 +0200 Subject: [PATCH 094/203] [MenuList] initialise onSelectionChanged before setting the list --- lib/python/Components/MenuList.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Components/MenuList.py b/lib/python/Components/MenuList.py index a80df3c7062..d94f8367e11 100644 --- a/lib/python/Components/MenuList.py +++ b/lib/python/Components/MenuList.py @@ -6,8 +6,8 @@ class MenuList(GUIComponent): def __init__(self, list, enableWrapAround=True, content=eListboxPythonStringContent): GUIComponent.__init__(self) self.l = content() - self.list = list self.onSelectionChanged = [] + self.list = list self.enableWrapAround = enableWrapAround def getCurrent(self): From 347a09ef96a63031471fd677a90d2ae3945f1569 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 13 Oct 2023 21:26:33 +0200 Subject: [PATCH 095/203] [InfoBarGenerics] tweak vbi code to avoid global --- lib/python/Screens/InfoBarGenerics.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index e3a84cfb91d..5bb1129f70e 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -162,12 +162,13 @@ def updateresumePointCache(): resumePointCache = loadResumePoints() resumePointCacheLast = int(time()) -whitelist_vbi = None + +class whitelist: + vbi = [] def reload_whitelist_vbi(): - global whitelist_vbi - whitelist_vbi = [line.strip() for line in open('/etc/enigma2/whitelist_vbi', 'r').readlines()] if os.path.isfile('/etc/enigma2/whitelist_vbi') else [] + whitelist.vbi = [line.strip() for line in open('/etc/enigma2/whitelist_vbi', 'r').readlines()] if os.path.isfile('/etc/enigma2/whitelist_vbi') else [] reload_whitelist_vbi() @@ -886,10 +887,10 @@ def checkHideVBI(self, service=None): service = service and eServiceReference(service) if service: print(service, service and service.toString()) - return service and ":".join(service.toString().split(":")[:11]) in whitelist_vbi + return service and ":".join(service.toString().split(":")[:11]) in whitelist.vbi else: return ".hidevbi." in servicepath.lower() - return service and service.toString() in whitelist_vbi + return service and service.toString() in whitelist.vbi def showHideVBI(self): if self.checkHideVBI(): @@ -901,12 +902,11 @@ def ToggleHideVBI(self, service=None): service = service or self.session.nav.getCurrentlyPlayingServiceReference() if service: service = service.toString() - global whitelist_vbi - if service in whitelist_vbi: - whitelist_vbi.remove(service) + if service in whitelist.vbi: + whitelist.vbi.remove(service) else: - whitelist_vbi.append(service) - open('/etc/enigma2/whitelist_vbi', 'w').write('\n'.join(whitelist_vbi)) + whitelist.vbi.append(service) + open('/etc/enigma2/whitelist_vbi', 'w').write('\n'.join(whitelist.vbi)) self.showHideVBI() def queueChange(self): From 21477d5badcce16bd9f3a9632f3c1ffa5bfd0664 Mon Sep 17 00:00:00 2001 From: Littlesat Date: Fri, 13 Oct 2023 14:22:45 +0200 Subject: [PATCH 096/203] Add embeded streamrelay functionality Stream relay is a function that e.g. Oscam offers and is a method where the hardware of the box is somehow not able to encrypt specific service. Streamrelay users a stream in between where the enryption is simulated in software. With this commit you can mark service refeerences stored in a whitelist /etc/enigma2/whitelist_streamrelay. When you try to tune one of these services the service ref is adapted in Navigate.py such a way that it plays the service via a stream relay server defined by two configs (IP, default local host and port default 17999). The whitelist can also be downloaded to you receiver and then you do not need special stream relay user bouquets anymore. You can also add/remove services via the channel list context menu. --- lib/python/Components/UsageConfig.py | 2 ++ lib/python/Navigation.py | 6 ++++++ lib/python/Screens/ChannelSelection.py | 8 ++++++++ lib/python/Screens/InfoBarGenerics.py | 20 ++++++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index e48b6503da7..8a42251da15 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -1136,6 +1136,8 @@ def setEpgLanguageAlternative(configElement): config.misc.softcamrestarts = ConfigSelection(default="", choices=[ ("", _("Don't restart")), ("s", _("Restart softcam"))]) + config.misc.softcam_streamrelay_url = ConfigIP(default=[127, 0, 0, 1], auto_jump=True) + config.misc.softcam_streamrelay_port = ConfigInteger(default=17999, limits=(0, 65535)) SystemInfo["OScamInstalled"] = False config.cccaminfo = ConfigSubsection() diff --git a/lib/python/Navigation.py b/lib/python/Navigation.py index ff80006de53..c31de741c7c 100644 --- a/lib/python/Navigation.py +++ b/lib/python/Navigation.py @@ -14,6 +14,7 @@ import NavigationInstance from Screens.InfoBar import InfoBar from Components.Sources.StreamService import StreamServiceList +from Screens.InfoBarGenerics import whitelist # TODO: remove pNavgation, eNavigation and rewrite this stuff in python. @@ -176,6 +177,11 @@ def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust else: self.skipServiceReferenceReset = True self.currentlyPlayingServiceReference = playref + playrefstring = playref.toString() + if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: + url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) + playref = eServiceReference("%s%s%s:%s" % (playrefstring, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) + print("[Navigation] Play service via streamrelay as it is whitelisted as such" ,playref.toString()) self.currentlyPlayingServiceOrGroup = ref if InfoBarInstance and InfoBarInstance.servicelist.servicelist.setCurrent(ref, adjust): self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent() diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 9b363223849..9ba39ebf776 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -207,6 +207,10 @@ def __init__(self, session, csel): _append_when_current_valid(current, menu, actions, (_("Uncover dashed flickering line for this service"), self.toggleVBI), level=1) else: _append_when_current_valid(current, menu, actions, (_("Cover dashed flickering line for this service"), self.toggleVBI), level=1) + if Screens.InfoBar.InfoBar.instance.checkStreamrelay(current): + _append_when_current_valid(current, menu, (_("Play service without streamrelay"), self.toggleStreamrelay), level=1) + else: + _append_when_current_valid(current, menu, (_("Play service with streamrelay"), self.toggleStreamrelay), level=1) if eDVBDB.getInstance().getCachedPid(eServiceReference(current.toString()), 9) >> 16 not in (-1, eDVBDB.getInstance().getCachedPid(eServiceReference(current.toString()), 2)): # Only show when a DVB subtitle is cached on this service if eDVBDB.getInstance().getFlag(eServiceReference(current.toString())) & FLAG_CENTER_DVB_SUBS: @@ -338,6 +342,10 @@ def toggleVBI(self): Screens.InfoBar.InfoBar.instance.showHideVBI() self.close() + def toggleStreamrelay(self): + Screens.InfoBar.InfoBar.instance.ToggleStreamrelay(self.csel.getCurrentSelection()) + self.close() + def addCenterDVBSubsFlag(self): eDVBDB.getInstance().addFlag(eServiceReference(self.csel.getCurrentSelection().toString()), FLAG_CENTER_DVB_SUBS) eDVBDB.getInstance().reloadBouquets() diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 5bb1129f70e..9117e5ba958 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -165,6 +165,7 @@ def updateresumePointCache(): class whitelist: vbi = [] + streamrelay = [] def reload_whitelist_vbi(): @@ -173,6 +174,12 @@ def reload_whitelist_vbi(): reload_whitelist_vbi() +def reload_streamrelay(): + whitelist.streamrelay = [line.strip() for line in open('/etc/enigma2/whitelist_streamrelay', 'r').readlines()] if os.path.isfile('/etc/enigma2/whitelist_streamrelay') else [] + + +reload_streamrelay() + subservice_groupslist = None @@ -892,6 +899,9 @@ def checkHideVBI(self, service=None): return ".hidevbi." in servicepath.lower() return service and service.toString() in whitelist.vbi + def checkStreamrelay(self, service=None): + return (service or self.session.nav.getCurrentlyPlayingServiceReference()) and service.toString() in whitelist.streamrelay + def showHideVBI(self): if self.checkHideVBI(): self.hideVBILineScreen.show() @@ -909,6 +919,16 @@ def ToggleHideVBI(self, service=None): open('/etc/enigma2/whitelist_vbi', 'w').write('\n'.join(whitelist.vbi)) self.showHideVBI() + def ToggleStreamrelay(self, service=None): + service = service or self.session.nav.getCurrentlyPlayingServiceReference() + if service: + service = service.toString() + if service in whitelist.streamrelay: + whitelist.streamrelay.remove(service) + else: + whitelist.streamrelay.append(service) + open('/etc/enigma2/whitelist_streamrelay', 'w').write('\n'.join(whitelist.streamrelay)) + def queueChange(self): self._waitForEventInfoTimer.stop() self._waitForEventInfoTimer.start(50, True) From 6504a3b041e2393d087557bff75c1f08eed6f106 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 13 Oct 2023 22:01:08 +0200 Subject: [PATCH 097/203] Navigation] cosmetic --- lib/python/Navigation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Navigation.py b/lib/python/Navigation.py index c31de741c7c..9ce9cfa75da 100644 --- a/lib/python/Navigation.py +++ b/lib/python/Navigation.py @@ -181,7 +181,7 @@ def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) playref = eServiceReference("%s%s%s:%s" % (playrefstring, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) - print("[Navigation] Play service via streamrelay as it is whitelisted as such" ,playref.toString()) + print("[Navigation] Play service via streamrelay as it is whitelisted as such", playref.toString()) self.currentlyPlayingServiceOrGroup = ref if InfoBarInstance and InfoBarInstance.servicelist.servicelist.setCurrent(ref, adjust): self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent() From 329c8143f04a20abacac84ec074056cce8ccc7b5 Mon Sep 17 00:00:00 2001 From: Littlesat Date: Fri, 13 Oct 2023 16:33:40 +0200 Subject: [PATCH 098/203] Arrange also the streamrelay automatisation for recordings --- lib/python/Navigation.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/python/Navigation.py b/lib/python/Navigation.py index 9ce9cfa75da..ffd9f83f7b2 100644 --- a/lib/python/Navigation.py +++ b/lib/python/Navigation.py @@ -177,11 +177,7 @@ def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust else: self.skipServiceReferenceReset = True self.currentlyPlayingServiceReference = playref - playrefstring = playref.toString() - if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: - url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) - playref = eServiceReference("%s%s%s:%s" % (playrefstring, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) - print("[Navigation] Play service via streamrelay as it is whitelisted as such", playref.toString()) + playref = self.streamrelayChecker(playref) self.currentlyPlayingServiceOrGroup = ref if InfoBarInstance and InfoBarInstance.servicelist.servicelist.setCurrent(ref, adjust): self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent() @@ -230,6 +226,14 @@ def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent() return 1 + def streamrelayChecker(self, playref): + playrefstring = playref.toString() + if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: + url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) + playref = eServiceReference("%s%s%s:%s" % (playrefstring, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) + print("[Navigation] Play or record service via streamrelay as it is whitelisted as such", playref.toString()) + return playref + def getCurrentlyPlayingServiceReference(self): return self.currentlyPlayingServiceReference @@ -243,6 +247,7 @@ def recordService(self, ref, simulate=False): if ref: if ref.flags & eServiceReference.isGroup: ref = getBestPlayableServiceReference(ref, eServiceReference(), simulate) + ref = self.streamrelayChecker(ref) service = ref and self.pnav and self.pnav.recordService(ref, simulate) if service is None: print("[Navigation] record returned non-zero") From 449ad4100942e6be0c2998fc34ba32b7a4f19d4f Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Fri, 13 Oct 2023 20:06:59 +0000 Subject: [PATCH 099/203] PEP8 double aggressive E301 ~ E306 --- lib/python/Screens/InfoBarGenerics.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 9117e5ba958..7070572edd2 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -174,6 +174,7 @@ def reload_whitelist_vbi(): reload_whitelist_vbi() + def reload_streamrelay(): whitelist.streamrelay = [line.strip() for line in open('/etc/enigma2/whitelist_streamrelay', 'r').readlines()] if os.path.isfile('/etc/enigma2/whitelist_streamrelay') else [] From bd7088d7b61488fbdeff80e05260200a920a21eb Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 13 Oct 2023 22:34:39 +0200 Subject: [PATCH 100/203] [ChannelSelection] tweak last commit for compatibility with openvix --- lib/python/Screens/ChannelSelection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 9ba39ebf776..1d833ad5365 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -208,9 +208,9 @@ def __init__(self, session, csel): else: _append_when_current_valid(current, menu, actions, (_("Cover dashed flickering line for this service"), self.toggleVBI), level=1) if Screens.InfoBar.InfoBar.instance.checkStreamrelay(current): - _append_when_current_valid(current, menu, (_("Play service without streamrelay"), self.toggleStreamrelay), level=1) + _append_when_current_valid(current, menu, actions, (_("Play service without streamrelay"), self.toggleStreamrelay), level=1) else: - _append_when_current_valid(current, menu, (_("Play service with streamrelay"), self.toggleStreamrelay), level=1) + _append_when_current_valid(current, menu, actions, (_("Play service with streamrelay"), self.toggleStreamrelay), level=1) if eDVBDB.getInstance().getCachedPid(eServiceReference(current.toString()), 9) >> 16 not in (-1, eDVBDB.getInstance().getCachedPid(eServiceReference(current.toString()), 2)): # Only show when a DVB subtitle is cached on this service if eDVBDB.getInstance().getFlag(eServiceReference(current.toString())) & FLAG_CENTER_DVB_SUBS: From 9b24100a39e84c3784db38c7212e5789d8824d61 Mon Sep 17 00:00:00 2001 From: Littlesat Date: Fri, 13 Oct 2023 13:38:44 +0200 Subject: [PATCH 101/203] Ensure and unrequired variable has a default value in ConfigIPUnreq The function getHTML is usefull here to get the IP-address from a ConfigIP in a string instead of a list of integer. But the function created for it needs a parameter. But this parameter is not used at all in the specific function. So I give it a default so it becomes not mandatory. But I need to keep it as I'm not aware where else it might be used when this function is called (especially in plugins etc) --- lib/python/Components/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 07ff31e10fa..00ada7e1199 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -898,7 +898,8 @@ def getMulti(self, selected): else: return "text", value - def getHTML(self, id): + def getHTML(self, id=0): + # I do not know why id is here but it is used in the sources renderer and I'm afraid we should keep it for compatibily. It is not used here but I give at a default value # we definitely don't want leading zeros return '.'.join(["%d" % d for d in self.value]) From d0599ae391994add83210b1e6a7ddbb2acab64e6 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 14 Oct 2023 00:16:09 +0200 Subject: [PATCH 102/203] [Navigation] add required import --- lib/python/Navigation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/python/Navigation.py b/lib/python/Navigation.py index ffd9f83f7b2..2ea04fe8ac7 100644 --- a/lib/python/Navigation.py +++ b/lib/python/Navigation.py @@ -10,6 +10,7 @@ from Tools.StbHardware import getFPWasTimerWakeup import RecordTimer import PowerTimer +from ServiceReference import ServiceReference import Screens.Standby import NavigationInstance from Screens.InfoBar import InfoBar From 34d4c7a6b359333786b1e33aa95bf89de651e3f6 Mon Sep 17 00:00:00 2001 From: Littlesat Date: Fri, 13 Oct 2023 23:09:08 +0200 Subject: [PATCH 103/203] Finetuning Streamrelay feature 1. When enable the feature and the service should be shown immediately restart the service so it is shown directly 2. Also do it for PictureInPicture --- lib/python/Navigation.py | 17 ++++++----------- lib/python/Screens/InfoBarGenerics.py | 19 +++++++++++++++---- lib/python/Screens/PictureInPicture.py | 3 ++- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/lib/python/Navigation.py b/lib/python/Navigation.py index 2ea04fe8ac7..eeeb27a3e8f 100644 --- a/lib/python/Navigation.py +++ b/lib/python/Navigation.py @@ -15,7 +15,7 @@ import NavigationInstance from Screens.InfoBar import InfoBar from Components.Sources.StreamService import StreamServiceList -from Screens.InfoBarGenerics import whitelist +from Screens.InfoBarGenerics import streamrelayChecker # TODO: remove pNavgation, eNavigation and rewrite this stuff in python. @@ -111,6 +111,9 @@ def dispatchRecordEvent(self, rec_service, event): except: pass + def restartService(self): + self.playService(self.currentlyPlayingServiceOrGroup, forceRestart=True) + def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust=True): oldref = self.currentlyPlayingServiceOrGroup if ref and oldref and ref == oldref and not forceRestart: @@ -178,7 +181,7 @@ def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust else: self.skipServiceReferenceReset = True self.currentlyPlayingServiceReference = playref - playref = self.streamrelayChecker(playref) + playref = streamrelayChecker(playref) self.currentlyPlayingServiceOrGroup = ref if InfoBarInstance and InfoBarInstance.servicelist.servicelist.setCurrent(ref, adjust): self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent() @@ -227,14 +230,6 @@ def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent() return 1 - def streamrelayChecker(self, playref): - playrefstring = playref.toString() - if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: - url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) - playref = eServiceReference("%s%s%s:%s" % (playrefstring, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) - print("[Navigation] Play or record service via streamrelay as it is whitelisted as such", playref.toString()) - return playref - def getCurrentlyPlayingServiceReference(self): return self.currentlyPlayingServiceReference @@ -248,7 +243,7 @@ def recordService(self, ref, simulate=False): if ref: if ref.flags & eServiceReference.isGroup: ref = getBestPlayableServiceReference(ref, eServiceReference(), simulate) - ref = self.streamrelayChecker(ref) + ref = streamrelayChecker(ref) service = ref and self.pnav and self.pnav.recordService(ref, simulate) if service is None: print("[Navigation] record returned non-zero") diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 7070572edd2..5acdf137815 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -184,6 +184,15 @@ def reload_streamrelay(): subservice_groupslist = None +def streamrelayChecker(playref): + playrefstring = playref.toString() + if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: + url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) + playref = eServiceReference("%s%s%s:%s" % (playrefstring, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) + print("[Navigation] Play or record service via streamrelay as it is whitelisted as such", playref.toString()) + return playref + + def reload_subservice_groupslist(force=False): global subservice_groupslist if subservice_groupslist is None or force: @@ -923,11 +932,13 @@ def ToggleHideVBI(self, service=None): def ToggleStreamrelay(self, service=None): service = service or self.session.nav.getCurrentlyPlayingServiceReference() if service: - service = service.toString() - if service in whitelist.streamrelay: - whitelist.streamrelay.remove(service) + servicestring = service.toString() + if servicestring in whitelist.streamrelay: + whitelist.streamrelay.remove(servicestring) else: - whitelist.streamrelay.append(service) + whitelist.streamrelay.append(servicestring) + if self.session.nav.getCurrentlyPlayingServiceReference() == service: + self.session.nav.restartService() open('/etc/enigma2/whitelist_streamrelay', 'w').write('\n'.join(whitelist.streamrelay)) def queueChange(self): diff --git a/lib/python/Screens/PictureInPicture.py b/lib/python/Screens/PictureInPicture.py index 5702de0a0b8..bd2ae5abc56 100644 --- a/lib/python/Screens/PictureInPicture.py +++ b/lib/python/Screens/PictureInPicture.py @@ -218,7 +218,8 @@ def getModeName(self): def playService(self, service): if service is None: return False - ref = self.resolveAlternatePipService(service) + from Screens.InfoBarGenerics import streamrelayChecker + ref = streamrelayChecker(self.resolveAlternatePipService(service)) if ref: if SystemInfo["CanNotDoSimultaneousTranscodeAndPIP"] and StreamServiceList: self.pipservice = None From 1dac5a4d654c89cd7696914db20ef233be197b2b Mon Sep 17 00:00:00 2001 From: Littlesat Date: Fri, 13 Oct 2023 23:23:04 +0200 Subject: [PATCH 104/203] Change the debug comments for the streamrelay checker Just to make it more general --- lib/python/Screens/InfoBarGenerics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 5acdf137815..7948ac423b3 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -189,7 +189,7 @@ def streamrelayChecker(playref): if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) playref = eServiceReference("%s%s%s:%s" % (playrefstring, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) - print("[Navigation] Play or record service via streamrelay as it is whitelisted as such", playref.toString()) + print("[Whitelist_StreamRelay] Play service via streamrelay as it is whitelisted as such", playref.toString()) return playref From 4d502e158ec7474b517b54f31b1c4ac45477b01b Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 14 Oct 2023 02:06:57 +0200 Subject: [PATCH 105/203] [Stream-relay] use fake namespace See: https://github.com/oscam-emu/oscam-patched/wiki/Stream-Relay-config ' Do NOT use the correct Transponder ID/Network ID/Namespace for the stream link. Instead, use dummy values like Transponder ID: "11", Network ID: "22" and Namespace: "33". ' --- lib/python/Components/UsageConfig.py | 1 + lib/python/Screens/InfoBarGenerics.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index 8a42251da15..a2774bf8817 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -1138,6 +1138,7 @@ def setEpgLanguageAlternative(configElement): ("s", _("Restart softcam"))]) config.misc.softcam_streamrelay_url = ConfigIP(default=[127, 0, 0, 1], auto_jump=True) config.misc.softcam_streamrelay_port = ConfigInteger(default=17999, limits=(0, 65535)) + config.misc.softcam_streamrelay_use_dummy_namespace = ConfigYesNo(default=True) SystemInfo["OScamInstalled"] = False config.cccaminfo = ConfigSubsection() diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 7948ac423b3..29ddced4767 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -187,8 +187,12 @@ def reload_streamrelay(): def streamrelayChecker(playref): playrefstring = playref.toString() if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: + playrefmod = playrefstring.split(":") + if config.misc.softcam_streamrelay_use_dummy_namespace.value: + playrefmod[6] = ("%x" % (int(playrefmod[6], 16) + 1)).upper() + playrefmod = ":".join(playrefmod) url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) - playref = eServiceReference("%s%s%s:%s" % (playrefstring, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) + playref = eServiceReference("%s%s%s:%s" % (playrefmod, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) print("[Whitelist_StreamRelay] Play service via streamrelay as it is whitelisted as such", playref.toString()) return playref From 4cdb630a8a152d25f5c03095251bc3ad1bae51c7 Mon Sep 17 00:00:00 2001 From: Orlandoxx <95180049+Orlandoxx@users.noreply.github.com> Date: Sat, 14 Oct 2023 10:23:45 +0300 Subject: [PATCH 106/203] Updated fi.po Added 'streamrelay' translations. --- po/fi.po | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/po/fi.po b/po/fi.po index 6490b32ceee..9e09e156d5f 100644 --- a/po/fi.po +++ b/po/fi.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: enigma2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-27 23:35+0000\n" -"PO-Revision-Date: 2023-10-13 07:29+0300\n" +"PO-Revision-Date: 2023-10-14 10:19+0300\n" "Last-Translator: Orlandox\n" "Language-Team: timoj/Kojo/Samzam/Orlandox\n" "Language: fi\n" @@ -13540,7 +13540,7 @@ msgstr "" "Suomenkielinen käännös: timoj, Kojo, Samzam, Orlandox\n" "\n" "Ylläpito : Orlandox\n" -"13.10.2023\n" +"14.10.2023\n" "http://www.huoltovalikko.com" msgid "TS file is too large for ISO9660 level 1!" @@ -19083,3 +19083,9 @@ msgstr "Asetusten varmuuskopiointi ennen päivitystä on erittäin suositeltavaa msgid "Please select a valid directory." msgstr "Valitse kelvollinen hakemisto." + +msgid "Play service without streamrelay" +msgstr "Toista kanava ilman streamrelay:tä" + +msgid "Play service with streamrelay" +msgstr "Toista kanava streamrelay:llä" From ab53e0529c211aa65584bd637f14784d43e476d1 Mon Sep 17 00:00:00 2001 From: Twol Date: Sat, 14 Oct 2023 09:54:35 +0200 Subject: [PATCH 107/203] [BackupManager] - fix add extra plugins directory --- .../SystemPlugins/ViX/BackupManager.py | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/lib/python/Plugins/SystemPlugins/ViX/BackupManager.py b/lib/python/Plugins/SystemPlugins/ViX/BackupManager.py index 0400214570d..4cc71c3ab1b 100644 --- a/lib/python/Plugins/SystemPlugins/ViX/BackupManager.py +++ b/lib/python/Plugins/SystemPlugins/ViX/BackupManager.py @@ -861,21 +861,17 @@ class XtraPluginsSelection(Screen): - - """, 560, 400, # screen - 0, 0, 140, 40, # colors - 140, 0, 140, 40, - 280, 0, 140, 40, - 0, 0, 140, 40, 20, - 140, 0, 140, 40, 20, - 280, 0, 140, 40, 20, + 0, 0, 140, 40, # red + 140, 0, 140, 40, # green + 0, 0, 140, 40, 20, # red + 140, 0, 140, 40, 20, # green 5, 50, 550, 250, 25, 19, - ] + ] # noqa: E124 def __init__(self, session): Screen.__init__(self, session) @@ -901,21 +897,15 @@ def __init__(self, session): "up": self.up, "menu": self.exit, }, -1) - if self.selectionChanged not in self["checkList"].onSelectionChanged: - self["checkList"].onSelectionChanged.append(self.selectionChanged) self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): idx = 0 self["checkList"].moveToIndex(idx) self.setWindowTitle() - self.selectionChanged() def setWindowTitle(self): - self.setTitle(_("Select folder that contains plugins")) - - def selectionChanged(self): - current = self["checkList"].getCurrent()[0] # what is this supposed to be doing + self.setTitle(_("Select folder containing plugins(.ipk) and Save")) def up(self): self["checkList"].up() @@ -930,15 +920,17 @@ def right(self): self["checkList"].pageDown() def saveSelection(self): - filelist = str(self.filelist.getFileList()) - if filelist.find(".ipk") != -1: - config.backupmanager.xtraplugindir.setValue(self.filelist.getCurrentDirectory()) + current = self["checkList"].getCurrent()[0] + # print("[BackupManager][saveSelection] current[0] ", current[0]) + ipkList = FileList(current[0], showDirectories=False, showFiles=True, showMountpoints=False, matchingPattern="^.*.(ipk)") + if ipkList.getFilename() is not None: + config.backupmanager.xtraplugindir.setValue(current[0]) config.backupmanager.xtraplugindir.save() config.backupmanager.save() config.save() self.close(None) else: - self.session.open(MessageBox, _("Please enter a folder that contains some packages."), MessageBox.TYPE_INFO, timeout=10) + self.session.open(MessageBox, _("Please select folder that contains .ipk packages."), MessageBox.TYPE_INFO, timeout=10) def exit(self): self.close(None) From 2859f455d9712652dcf65154a7b608e215e9b73f Mon Sep 17 00:00:00 2001 From: Orlandoxx <95180049+Orlandoxx@users.noreply.github.com> Date: Sat, 14 Oct 2023 11:46:14 +0300 Subject: [PATCH 108/203] Updated fi.po Changed 'BackupManager.py' translations. --- po/fi.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/po/fi.po b/po/fi.po index 9e09e156d5f..d50c0704413 100644 --- a/po/fi.po +++ b/po/fi.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: enigma2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-27 23:35+0000\n" -"PO-Revision-Date: 2023-10-14 10:19+0300\n" +"PO-Revision-Date: 2023-10-14 11:41+0300\n" "Last-Translator: Orlandox\n" "Language-Team: timoj/Kojo/Samzam/Orlandox\n" "Language: fi\n" @@ -18668,8 +18668,8 @@ msgstr "OK, suorita palautus" msgid "Partition: %s Mount: %s unmounted successfully; if all partitions now unmounted you can remove device." msgstr "Partitio: %s Liitos: %s liitos poistettu onnistuneesti; jos kaikkien partitioiden liitokset poistettu, voit poistaa laitteen." -msgid "Please enter a folder that contains some packages." -msgstr "Valitse hakemisto joka sisältää asennuspaketteja." +msgid "Please select folder that contains .ipk packages." +msgstr "Valitse hakemisto, joka sisältää .ipk-paketteja." msgid "Please select device to use as SWAP file location." msgstr "Valitse laite, jota käytetään SWAP-tiedoston tallentamiseen." @@ -18811,8 +18811,8 @@ msgstr "Valitse flashattava image." msgid "Select extra packages folder" msgstr "Valitse lisäohjelmapakettien hakemisto" -msgid "Select folder that contains plugins" -msgstr "Valitse hakemisto joka sisältää lisäosat" +msgid "Select folder containing plugins(.ipk) and Save" +msgstr "Valitse laajennuksia sisältävä hakemisto (.ipk) ja Tallenna" msgid "Select the SWAP file size:" msgstr "Valitse SWAP:n koko:" From d159772d97c3e2e82c4e9eb9e20c7891e7bbf70c Mon Sep 17 00:00:00 2001 From: Orlandoxx <95180049+Orlandoxx@users.noreply.github.com> Date: Sat, 14 Oct 2023 11:48:42 +0300 Subject: [PATCH 109/203] Updated fi.po Corrected one word. --- po/fi.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fi.po b/po/fi.po index d50c0704413..c02e710fd16 100644 --- a/po/fi.po +++ b/po/fi.po @@ -18812,7 +18812,7 @@ msgid "Select extra packages folder" msgstr "Valitse lisäohjelmapakettien hakemisto" msgid "Select folder containing plugins(.ipk) and Save" -msgstr "Valitse laajennuksia sisältävä hakemisto (.ipk) ja Tallenna" +msgstr "Valitse lisäosia sisältävä hakemisto (.ipk) ja Tallenna" msgid "Select the SWAP file size:" msgstr "Valitse SWAP:n koko:" From 87d1174e116eb898f3108bbedcf4335c81eaecac Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 14 Oct 2023 20:31:52 +0200 Subject: [PATCH 110/203] [setup/menu.xml] expose stream relay config --- data/menu.xml | 1 + data/setup.xml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/data/menu.xml b/data/menu.xml index 1c4f8de43b8..ff1c045270a 100644 --- a/data/menu.xml +++ b/data/menu.xml @@ -149,6 +149,7 @@ self.session.open(SABnzbdSetupScreen) + diff --git a/data/setup.xml b/data/setup.xml index 6bf5477b2ec..18d2521ca9d 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -324,6 +324,11 @@ config.oscaminfo.autoupdate config.oscaminfo.intervall + + + config.misc.softcam_streamrelay_url + config.misc.softcam_streamrelay_port + config.misc.softcam_streamrelay_use_dummy_namespace config.misc.softcams From 6c77d2dcc8ab3380b8df77e974364759350a5178 Mon Sep 17 00:00:00 2001 From: Orlandoxx <95180049+Orlandoxx@users.noreply.github.com> Date: Sun, 15 Oct 2023 09:15:47 +0300 Subject: [PATCH 111/203] Updated fi.po Added 'Stream relay' translations. --- po/fi.po | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/po/fi.po b/po/fi.po index c02e710fd16..de054b773f0 100644 --- a/po/fi.po +++ b/po/fi.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: enigma2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-27 23:35+0000\n" -"PO-Revision-Date: 2023-10-14 11:41+0300\n" +"PO-Revision-Date: 2023-10-15 09:11+0300\n" "Last-Translator: Orlandox\n" "Language-Team: timoj/Kojo/Samzam/Orlandox\n" "Language: fi\n" @@ -13540,7 +13540,7 @@ msgstr "" "Suomenkielinen käännös: timoj, Kojo, Samzam, Orlandox\n" "\n" "Ylläpito : Orlandox\n" -"14.10.2023\n" +"15.10.2023\n" "http://www.huoltovalikko.com" msgid "TS file is too large for ISO9660 level 1!" @@ -19085,7 +19085,28 @@ msgid "Please select a valid directory." msgstr "Valitse kelvollinen hakemisto." msgid "Play service without streamrelay" -msgstr "Toista kanava ilman streamrelay:tä" +msgstr "Toista kanava ilman stream relay:tä" msgid "Play service with streamrelay" -msgstr "Toista kanava streamrelay:llä" +msgstr "Toista kanava stream relay:llä" + +msgid "Stream relay" +msgstr "Stream relay" + +msgid "Stream relay url" +msgstr "Stream relay -url" + +msgid "Stream relay url will normally be the default" +msgstr "Stream relay -url on normaalisti oletusarvo" + +msgid "Stream relay port" +msgstr "Stream relay -portti" + +msgid "Stream relay port will normally be the default" +msgstr "Stream relay -portti on normaalisti oletusarvo" + +msgid "Stream relay use dummy namespace" +msgstr "Stream relay, käytä valenimiavaruutta" + +msgid "Some binaries require a dummy namespace" +msgstr "Jotkin binäärit vaativat valenimiavaruuden" From 777d7216b4690ef4af238b8f771203a51669eb1c Mon Sep 17 00:00:00 2001 From: Huevos Date: Sun, 15 Oct 2023 11:52:25 +0200 Subject: [PATCH 112/203] [menu] tweak stream relay entry --- data/menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/menu.xml b/data/menu.xml index ff1c045270a..0e90e09363c 100644 --- a/data/menu.xml +++ b/data/menu.xml @@ -149,7 +149,7 @@ self.session.open(SABnzbdSetupScreen) - + From 1359a2a1578d5920fcab2e559ae45b6b85f2dde7 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sun, 15 Oct 2023 11:53:32 +0200 Subject: [PATCH 113/203] [Pager] fix for when "List" is inherited --- lib/python/Components/Addons/Pager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/Addons/Pager.py b/lib/python/Components/Addons/Pager.py index 267ad1d0221..e30c22cc4cc 100644 --- a/lib/python/Components/Addons/Pager.py +++ b/lib/python/Components/Addons/Pager.py @@ -5,6 +5,7 @@ from skin import parseScale, applySkinFactor from Components.MultiContent import MultiContentEntryPixmapAlphaBlend +from Components.Sources.List import List from Tools.Directories import resolveFilename, SCOPE_GUISKIN from Tools.LoadPixmap import LoadPixmap @@ -89,7 +90,7 @@ def postWidgetCreate(self, instance): instance.allowNativeKeys(False) def getSourceOrientation(self): - if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu + if isinstance(self.source, List): # Components.Sources.List orig_source = self.source.master.master else: orig_source = self.source @@ -103,7 +104,7 @@ def getCurrentIndex(self): return self.source.l.getCurrentSelectionIndex() def getSourceSize(self): - if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu + if isinstance(self.source, List): # Components.Sources.List return self.source.master.master.instance.size() return self.source.instance.size() @@ -115,7 +116,7 @@ def getListCount(self): return 0 def getListItemSize(self): - if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu + if isinstance(self.source, List): # Components.Sources.List orig_source = self.source.master.master else: orig_source = self.source From c4762713cba831b3491b6c3fd48271c58e553140 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Sun, 15 Oct 2023 18:57:20 +0300 Subject: [PATCH 114/203] - add getMaxTextWidth to eListboxPythonMultiContent --- lib/gui/elistboxcontent.cpp | 106 ++++++++++++++++++++++++++++++++++++ lib/gui/elistboxcontent.h | 1 + 2 files changed, 107 insertions(+) diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 9af0b3b5368..c0cd808ba51 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -884,6 +884,112 @@ static ePyObject lookupColor(ePyObject color, ePyObject data) return color; } +int eListboxPythonMultiContent::getMaxItemTextWidth() +{ + ePtr fnt; + eListboxStyle *local_style = 0; + int m_text_offset = 1; + if (m_listbox) + local_style = m_listbox->getLocalStyle(); + if (local_style) { + fnt = local_style->m_font; + m_text_offset = local_style->m_text_offset.x(); + } + if (!fnt) fnt = new gFont("Regular", 20); + + ePyObject items, buildfunc_ret; + if (m_list) { + for (int k = 0; k < size(); k++) + { + items = PyList_GET_ITEM(m_list, k); // borrowed reference! + + if (m_buildFunc) + { + if (PyCallable_Check(m_buildFunc)) // when we have a buildFunc then call it + { + if (PyTuple_Check(items)) + buildfunc_ret = items = PyObject_CallObject(m_buildFunc, items); + else + eDebug("[eListboxPythonMultiContent] items is not a tuple"); + } + else + eDebug("[eListboxPythonMultiContent] buildfunc is not callable"); + } + + ePyObject data; + + /* if we have a template, use the template for the actual formatting. + we will later detect that "data" is present, and refer to that, instead + of the immediate value. */ + int start = 1; + if (m_template) + { + data = items; + items = m_template; + start = 0; + } + + int items_size = PyList_Size(items); + for (int i = start; i < items_size; ++i) { + ePyObject item = PyList_GET_ITEM(items, i); // borrowed reference! + + if (!item) + { + eDebug("[eListboxPythonMultiContent] no items[%d] ?", i); + continue; + } + + if (!PyTuple_Check(item)) + { + eDebug("[eListboxPythonMultiContent] items[%d] is not a tuple.", i); + continue; + } + + int size = PyTuple_Size(item); + + if (!size) + { + eDebug("[eListboxPythonMultiContent] items[%d] is an empty tuple.", i); + continue; + } + + int type = PyLong_AsLong(PyTuple_GET_ITEM(item, 0)); + + switch (type) + { + case TYPE_TEXT: // text + { + ePyObject px = PyTuple_GET_ITEM(item, 1), pstring = PyTuple_GET_ITEM(item, 7); + + if (PyLong_Check(pstring) && data) /* if the string is in fact a number, it refers to the 'data' list. */ + pstring = PyTuple_GetItem(data, PyLong_AsLong(pstring)); + + /* don't do anything if we have 'None' as string */ + if (pstring == Py_None) + continue; + + const char *string = (PyUnicode_Check(pstring)) ? PyUnicode_AsUTF8(pstring) : ""; + eRect textRect = eRect(0,0, 9999, 100); + + ePtr para = new eTextPara(textRect); + para->setFont(fnt); + para->renderString(string); + int textWidth = para->getBoundBox().width() + PyLong_AsLong(px); + if (textWidth > m_max_text_width) { + m_max_text_width = textWidth; + } + break; + } + } + + } + } + + } + + return m_max_text_width + (m_text_offset*2); +} + void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected) { gRegion itemregion(eRect(offset, m_itemsize)); diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h index 60daf87160d..9b83413efcf 100644 --- a/lib/gui/elistboxcontent.h +++ b/lib/gui/elistboxcontent.h @@ -95,6 +95,7 @@ class eListboxPythonMultiContent: public eListboxPythonStringContent void resetClip(); void entryRemoved(int idx); void setTemplate(SWIG_PYOBJECT(ePyObject) tmplate); + int getMaxItemTextWidth(); private: std::map > m_font; }; From 016bd29f2e28d02d721efcd02468046eb305131e Mon Sep 17 00:00:00 2001 From: openvix-build Date: Sun, 15 Oct 2023 19:24:32 +0000 Subject: [PATCH 115/203] openvix: developer 6.4.008.011 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 6eb7f35d9c9..3b2b6f32cc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1181,3 +1181,4 @@ openvix: developer 6.4.008.007 openvix: developer 6.4.008.008 openvix: developer 6.4.008.009 openvix: developer 6.4.008.010 +openvix: developer 6.4.008.011 From 7730e2181ec8a865e26a86364e5079c1819638e8 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sun, 15 Oct 2023 22:58:28 +0200 Subject: [PATCH 116/203] [TimerList] add comment --- lib/python/Components/TimerList.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index 7e2d3ac0057..e967a95df07 100644 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -143,7 +143,7 @@ def __init__(self, list): self.eventNameFont = gFont("Regular", 18) self.l.setList(list) - self.listCount = len(list) + self.listCount = len(list) # used by pager self.itemHeight = 50 self.rowSplit = 25 self.iconMargin = 4 @@ -209,7 +209,7 @@ def getCurrent(self): def setList(self, list): self.l.setList(list) - self.listCount = len(list) + self.listCount = len(list) # used by pager self.selectionChanged() def postWidgetCreate(self, instance): From 26f4eb780710f81e40c90dc7bc20e0a84a595a74 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sun, 15 Oct 2023 22:59:42 +0200 Subject: [PATCH 117/203] [PowerTimer] add onSelectionChanged --- lib/python/Components/PowerTimerList.py | 12 ++++++++++++ lib/python/Screens/PowerTimerEdit.py | 1 + 2 files changed, 13 insertions(+) diff --git a/lib/python/Components/PowerTimerList.py b/lib/python/Components/PowerTimerList.py index 466c1dee5be..3308d290f8c 100644 --- a/lib/python/Components/PowerTimerList.py +++ b/lib/python/Components/PowerTimerList.py @@ -124,12 +124,14 @@ def buildTimerEntry(self, timer, processed): def __init__(self, list): GUIComponent.__init__(self) + self.onSelectionChanged = [] self.l = eListboxPythonMultiContent() self.l.setBuildFunc(self.buildTimerEntry) self.serviceNameFont = gFont("Regular", 20) self.font = gFont("Regular", 18) self.eventNameFont = gFont("Regular", 18) self.l.setList(list) + self.listCount = len(list) # used by pager self.itemHeight = 50 self.rowSplit = 25 self.iconMargin = 4 @@ -177,6 +179,7 @@ def satPosLeft(value): self.l.setFont(0, self.serviceNameFont) self.l.setFont(1, self.font) self.l.setFont(2, self.eventNameFont) + self.selectionChanged() return GUIComponent.applySkin(self, desktop, parent) def getCurrent(self): @@ -186,9 +189,18 @@ def getCurrent(self): GUI_WIDGET = eListbox def postWidgetCreate(self, instance): + instance.selectionChanged.get().append(self.selectionChanged) instance.setContent(self.l) self.instance = instance + def preWidgetRemove(self, instance): + instance.selectionChanged.get().remove(self.selectionChanged) + instance.setContent(None) + + def selectionChanged(self): + for x in self.onSelectionChanged: + x() + def moveToIndex(self, index): self.instance.moveSelectionTo(index) diff --git a/lib/python/Screens/PowerTimerEdit.py b/lib/python/Screens/PowerTimerEdit.py index b091af01278..311d45f3aa6 100644 --- a/lib/python/Screens/PowerTimerEdit.py +++ b/lib/python/Screens/PowerTimerEdit.py @@ -59,6 +59,7 @@ def __init__(self, session): }, -1) self.session.nav.PowerTimer.on_state_change.append(self.onStateChange) self.onShown.append(self.updateState) + self["timerlist"].selectionChanged() def createSummary(self): return PowerTimerEditListSummary From de520f6824c683000c0b15286729d41081ecbe05 Mon Sep 17 00:00:00 2001 From: Ev0-BH Date: Sun, 15 Oct 2023 20:23:20 +0100 Subject: [PATCH 118/203] Minor tweaks for SR --- data/menu.xml | 1 - data/setup.xml | 8 +++----- lib/python/Components/Converter/StreamInfo.py | 8 +++++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/data/menu.xml b/data/menu.xml index 0e90e09363c..1c4f8de43b8 100644 --- a/data/menu.xml +++ b/data/menu.xml @@ -149,7 +149,6 @@ self.session.open(SABnzbdSetupScreen) - diff --git a/data/setup.xml b/data/setup.xml index 18d2521ca9d..3ba5e72c304 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -313,6 +313,9 @@ config.cccaminfo.showInExtensions config.oscaminfo.showInExtensions + config.misc.softcam_streamrelay_url + config.misc.softcam_streamrelay_port + config.misc.softcam_streamrelay_use_dummy_namespace config.oscaminfo.userdatafromconf @@ -325,11 +328,6 @@ config.oscaminfo.autoupdate config.oscaminfo.intervall - - config.misc.softcam_streamrelay_url - config.misc.softcam_streamrelay_port - config.misc.softcam_streamrelay_use_dummy_namespace - config.misc.softcams config.misc.softcamrestarts diff --git a/lib/python/Components/Converter/StreamInfo.py b/lib/python/Components/Converter/StreamInfo.py index 263397ea461..1cb9b88a91c 100644 --- a/lib/python/Components/Converter/StreamInfo.py +++ b/lib/python/Components/Converter/StreamInfo.py @@ -21,7 +21,10 @@ def streamtype(self): if playref: refstr = playref.toString() strtype = refstr.replace('%3a', ':') - if strtype.startswith('1:0:'): + streamrelay = [line.strip() for line in open('/etc/enigma2/whitelist_streamrelay', 'r').readlines()] + if refstr in streamrelay: + return 'iCAM' + elif strtype.startswith('1:0:'): if bool([1 for x in ('0.0.0.0:', '127.0.0.1:', 'localhost:') if x in strtype]): return 'Stream Relay' elif '%3a' in refstr: @@ -36,8 +39,11 @@ def streamtype(self): def streamurl(self): playref = NavigationInstance.instance.getCurrentlyPlayingServiceReference() + streamrelay = [line.strip() for line in open('/etc/enigma2/whitelist_streamrelay', 'r').readlines()] if playref: refstr = playref.toString() + if refstr in streamrelay: + return 'Stream Relay' if '%3a' in refstr: strurl = refstr.split(':') streamurl = strurl[10].replace('%3a', ':').replace('http://', '').replace('https://', '').split('/1:0:')[0].split('//')[0].split('/')[0].split('@')[-1] From 398ba320a19a12d563f68a4930b3251ea6e4a4a2 Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 16 Oct 2023 01:04:06 +0200 Subject: [PATCH 119/203] [StreamInfo] tweak https://github.com/OpenViX/enigma2/commit/de520f6824c683000c0b15286729d41081ecbe05 --- lib/python/Components/Converter/StreamInfo.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/python/Components/Converter/StreamInfo.py b/lib/python/Components/Converter/StreamInfo.py index 1cb9b88a91c..42e7ef3bc73 100644 --- a/lib/python/Components/Converter/StreamInfo.py +++ b/lib/python/Components/Converter/StreamInfo.py @@ -1,5 +1,6 @@ from Components.Converter.Converter import Converter from Components.Element import cached +from Screens.InfoBarGenerics import whitelist import NavigationInstance from enigma import iPlayableService @@ -21,8 +22,7 @@ def streamtype(self): if playref: refstr = playref.toString() strtype = refstr.replace('%3a', ':') - streamrelay = [line.strip() for line in open('/etc/enigma2/whitelist_streamrelay', 'r').readlines()] - if refstr in streamrelay: + if refstr in whitelist.streamrelay: return 'iCAM' elif strtype.startswith('1:0:'): if bool([1 for x in ('0.0.0.0:', '127.0.0.1:', 'localhost:') if x in strtype]): @@ -39,10 +39,9 @@ def streamtype(self): def streamurl(self): playref = NavigationInstance.instance.getCurrentlyPlayingServiceReference() - streamrelay = [line.strip() for line in open('/etc/enigma2/whitelist_streamrelay', 'r').readlines()] if playref: refstr = playref.toString() - if refstr in streamrelay: + if refstr in whitelist.streamrelay: return 'Stream Relay' if '%3a' in refstr: strurl = refstr.split(':') From 71743764f4f93cea676dce4458b4edb9f97020b4 Mon Sep 17 00:00:00 2001 From: openvix-build Date: Sun, 15 Oct 2023 23:24:51 +0000 Subject: [PATCH 120/203] openvix: developer 6.4.008.012 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 3b2b6f32cc3..838b4afb0df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1182,3 +1182,4 @@ openvix: developer 6.4.008.008 openvix: developer 6.4.008.009 openvix: developer 6.4.008.010 openvix: developer 6.4.008.011 +openvix: developer 6.4.008.012 From 02e514ccc68c22eed05039cc49bb908e6a0c5336 Mon Sep 17 00:00:00 2001 From: Littlesat Date: Mon, 16 Oct 2023 10:52:45 +0200 Subject: [PATCH 121/203] [InfoBarGenerics] When streamrelay server is local host modify the service reference It seems this is needed for the current oscam binaries but it is not clear why. It also makes it less transparant. It worked when it was used on a fallback clinet where I developed the feature on, but not on the box where the oscam binary is really running on. I think we still need to investigate why we need a fake service ref here and try to find a way to resolve it that it is not required. To avoid an extra config I used the local host for the detecting when it is needed localy. So on fallback clients you automatically get better data in the OSD. --- lib/python/Screens/InfoBarGenerics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 29ddced4767..b768dd03298 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -187,11 +187,11 @@ def reload_streamrelay(): def streamrelayChecker(playref): playrefstring = playref.toString() if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: - playrefmod = playrefstring.split(":") - if config.misc.softcam_streamrelay_use_dummy_namespace.value: - playrefmod[6] = ("%x" % (int(playrefmod[6], 16) + 1)).upper() - playrefmod = ":".join(playrefmod) url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) + if "127.0.0.1" in url: + playrefmod = ":".join([("%x" % (int(x[1], 16) + 1)).upper() if x[0] == 6 else x[1] for x in enumerate(playrefstring.split(':'))]) + else: + playrefmod = playrefstring playref = eServiceReference("%s%s%s:%s" % (playrefmod, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) print("[Whitelist_StreamRelay] Play service via streamrelay as it is whitelisted as such", playref.toString()) return playref From 5f28cae3505544552776fa51cbeda7e5e9f19dda Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 16 Oct 2023 14:33:32 +0200 Subject: [PATCH 122/203] [UsageConfig/setp.xml] cleanup following sream relay testing --- data/setup.xml | 3 --- lib/python/Components/UsageConfig.py | 1 - 2 files changed, 4 deletions(-) diff --git a/data/setup.xml b/data/setup.xml index 3ba5e72c304..5772fe636b5 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -313,9 +313,6 @@ config.cccaminfo.showInExtensions config.oscaminfo.showInExtensions - config.misc.softcam_streamrelay_url - config.misc.softcam_streamrelay_port - config.misc.softcam_streamrelay_use_dummy_namespace config.oscaminfo.userdatafromconf diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index a2774bf8817..8a42251da15 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -1138,7 +1138,6 @@ def setEpgLanguageAlternative(configElement): ("s", _("Restart softcam"))]) config.misc.softcam_streamrelay_url = ConfigIP(default=[127, 0, 0, 1], auto_jump=True) config.misc.softcam_streamrelay_port = ConfigInteger(default=17999, limits=(0, 65535)) - config.misc.softcam_streamrelay_use_dummy_namespace = ConfigYesNo(default=True) SystemInfo["OScamInstalled"] = False config.cccaminfo = ConfigSubsection() From 049a51083006f8eab7cecd7ca29d673680334b48 Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 16 Oct 2023 15:04:56 +0200 Subject: [PATCH 123/203] [setup.xml] stream relay options --- data/setup.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/setup.xml b/data/setup.xml index 5772fe636b5..79a0f241d54 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -22,6 +22,8 @@ config.streaming.stream_ecm config.streaming.descramble config.streaming.descramble_client + config.misc.softcam_streamrelay_url + config.misc.softcam_streamrelay_port config.streaming.authentication config.usage.http_startdelay config.usage.wakeOnLAN From e57cc84aff6958cb3c1477733598179cbee8eaf1 Mon Sep 17 00:00:00 2001 From: openvix-build Date: Mon, 16 Oct 2023 13:06:49 +0000 Subject: [PATCH 124/203] openvix: developer 6.4.008.013 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 838b4afb0df..f01e3fa0688 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1183,3 +1183,4 @@ openvix: developer 6.4.008.009 openvix: developer 6.4.008.010 openvix: developer 6.4.008.011 openvix: developer 6.4.008.012 +openvix: developer 6.4.008.013 From 8bbc7c9035e11b23d8f0fc732c9e2ca65fbd51e5 Mon Sep 17 00:00:00 2001 From: Huevos Date: Wed, 18 Oct 2023 22:13:00 +0200 Subject: [PATCH 125/203] [ChoiceBox] add comment --- lib/python/Screens/ChoiceBox.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py index 5419548bc01..c6af17f72fd 100644 --- a/lib/python/Screens/ChoiceBox.py +++ b/lib/python/Screens/ChoiceBox.py @@ -132,6 +132,9 @@ def __init__(self, session, title="", list=None, keys=None, selection=0, skin_na }, prio=-2) def autoResize(self): + # This needs fixing to use self["list"].instance.getMaxItemTextWidth(). + # Currently it is just fetching the list width from skin.xml, but that + # is fixed width so scaling the list will not work. desktop_w = enigma.getDesktop(0).size().width() desktop_h = enigma.getDesktop(0).size().height() itemheight = self["list"].getItemHeight() From 082ddb0ded42796e398ff60c02f30522313527a7 Mon Sep 17 00:00:00 2001 From: Huevos Date: Wed, 18 Oct 2023 22:14:01 +0200 Subject: [PATCH 126/203] [Converter] don't add space around the seperation char --- lib/python/Components/Converter/Converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Components/Converter/Converter.py b/lib/python/Components/Converter/Converter.py index fc3212b985f..b50fb3a50b7 100644 --- a/lib/python/Components/Converter/Converter.py +++ b/lib/python/Components/Converter/Converter.py @@ -17,5 +17,5 @@ def appendToStringWithSeparator(self, str, part): if str == "": str = part else: - str = str + " " + self.separatorChar + " " + part + str = str + self.separatorChar + part return str From e7c048602957fdfde895f8b8a990da2a35e0c64b Mon Sep 17 00:00:00 2001 From: Huevos Date: Wed, 18 Oct 2023 22:17:11 +0200 Subject: [PATCH 127/203] [MovieSelection] tweak title separation char --- lib/python/Screens/MovieSelection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/MovieSelection.py b/lib/python/Screens/MovieSelection.py index 6e282d13560..6206d5b3eb6 100644 --- a/lib/python/Screens/MovieSelection.py +++ b/lib/python/Screens/MovieSelection.py @@ -1734,7 +1734,7 @@ def reloadWithDelay(self): self.callLater(self.enablePathSelect) def updateTitle(self): - separatorChar = parameters.get("MovieSelectionTitleSeparatorChar", "-") + separatorChar = parameters.get("MovieSelectionTitleSeparatorChar", " - ") title = [] if config.usage.setup_level.index >= 2: # expert+ title.append(config.movielist.last_videodir.value) @@ -1742,7 +1742,7 @@ def updateTitle(self): title.append(','.join(self.selected_tags)) if self.collectionName: title.append(self.collectionName) - self.title = (" %s " % separatorChar).join(title) + self.title = separatorChar.join(title) def enablePathSelect(self): self.pathselectEnabled = True From df62fc6559e4f4338a1389702fd6c7b0126818fe Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Thu, 19 Oct 2023 08:38:36 +0300 Subject: [PATCH 128/203] [eListboxPythonMultiContent] added missing font variable to the formula for calculating max text width --- lib/gui/elistboxcontent.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index c0cd808ba51..4254ba3a211 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -959,11 +959,16 @@ int eListboxPythonMultiContent::getMaxItemTextWidth() { case TYPE_TEXT: // text { - ePyObject px = PyTuple_GET_ITEM(item, 1), pstring = PyTuple_GET_ITEM(item, 7); + ePyObject px = PyTuple_GET_ITEM(item, 1), pfnt = PyTuple_GET_ITEM(item, 5), pstring = PyTuple_GET_ITEM(item, 7); if (PyLong_Check(pstring) && data) /* if the string is in fact a number, it refers to the 'data' list. */ pstring = PyTuple_GetItem(data, PyLong_AsLong(pstring)); + if (pfnt) { + int fnt_i = PyLong_AsLong(pfnt); + fnt = m_font[fnt_i]; + } + /* don't do anything if we have 'None' as string */ if (pstring == Py_None) continue; From d18aa080c0baf9d1d474009039ecabeaa039fa5f Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Thu, 19 Oct 2023 11:25:44 +0300 Subject: [PATCH 129/203] - add additional check for font index existence --- lib/gui/elistboxcontent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 4254ba3a211..3f68334da68 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -966,7 +966,7 @@ int eListboxPythonMultiContent::getMaxItemTextWidth() if (pfnt) { int fnt_i = PyLong_AsLong(pfnt); - fnt = m_font[fnt_i]; + if (m_font.find(fnt_i) != m_font.end()) fnt = m_font[fnt_i]; } /* don't do anything if we have 'None' as string */ From 9288324e26257f969c42637686a2e247125a449b Mon Sep 17 00:00:00 2001 From: openvix-build Date: Thu, 19 Oct 2023 14:20:32 +0000 Subject: [PATCH 130/203] openvix: developer 6.4.009.001 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index f01e3fa0688..14829f7e833 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1184,3 +1184,4 @@ openvix: developer 6.4.008.010 openvix: developer 6.4.008.011 openvix: developer 6.4.008.012 openvix: developer 6.4.008.013 +openvix: developer 6.4.009.001 From 8062bae10e6421a0876d322b0a7fed95ff64edd5 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 20 Oct 2023 02:42:58 +0200 Subject: [PATCH 131/203] [ChoiceList] make the text width the same as the screenwidth to avoid breaking autoresize --- lib/python/Components/ChoiceList.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Components/ChoiceList.py b/lib/python/Components/ChoiceList.py index df2498baa6e..a69d9d5d89a 100644 --- a/lib/python/Components/ChoiceList.py +++ b/lib/python/Components/ChoiceList.py @@ -18,7 +18,7 @@ def ChoiceEntryComponent(key=None, text=None): if text[0] == "--": # Do we want graphical separator (solid line with color) or dashed line isUseGraphicalSeparator = parameters.get("ChoicelistUseGraphicalSeparator", 0) - x, y, w, h = parameters.get("ChoicelistDash", applySkinFactor(0, 2, 800, 25)) + x, y, w, h = parameters.get("ChoicelistDash", applySkinFactor(0, 2, 1280, 25)) if isUseGraphicalSeparator: bk_color = parameters.get("ChoicelistSeparatorColor", "0x00555556") res.append( @@ -32,7 +32,7 @@ def ChoiceEntryComponent(key=None, text=None): else: res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, "-" * 200)) else: - x, y, w, h = parameters.get("ChoicelistName", applySkinFactor(45, 2, 800, 25)) + x, y, w, h = parameters.get("ChoicelistName", applySkinFactor(45, 2, 1280, 25)) res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, text[0])) if key: # separate the sizes definition for keybutton is=cons and the rest so there to be possibility to use different size images for different type icons From 8bed091889f42734ee1002d7f6f9daccdff1de0d Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 20 Oct 2023 02:44:35 +0200 Subject: [PATCH 132/203] [ChoiceBox] rewrite autoresize --- lib/python/Screens/ChoiceBox.py | 51 ++++++++++++++------------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py index c6af17f72fd..f9eb6f40b90 100644 --- a/lib/python/Screens/ChoiceBox.py +++ b/lib/python/Screens/ChoiceBox.py @@ -7,6 +7,7 @@ from Components.Sources.StaticText import StaticText from Tools.BoundFunction import boundFunction import enigma +from skin import applySkinFactor config.misc.pluginlist = ConfigSubsection() config.misc.pluginlist.eventinfo_order = ConfigText(default="") @@ -132,42 +133,34 @@ def __init__(self, session, title="", list=None, keys=None, selection=0, skin_na }, prio=-2) def autoResize(self): - # This needs fixing to use self["list"].instance.getMaxItemTextWidth(). - # Currently it is just fetching the list width from skin.xml, but that - # is fixed width so scaling the list will not work. + margin = applySkinFactor(4) + separator = 10 desktop_w = enigma.getDesktop(0).size().width() desktop_h = enigma.getDesktop(0).size().height() itemheight = self["list"].getItemHeight() - count = len(self.list) - if count > 15: - count = 15 - width = self["list"].instance.size().width() - if width < 0 or width > desktop_w: - width = 520 - if not self["text"].text: - # move list - textsize = (width, 0) - listsize = (width, itemheight * count) - self["list"].instance.move(enigma.ePoint(0, 0)) - self["list"].instance.resize(enigma.eSize(*listsize)) - else: - textsize = self["text"].getSize() - if textsize[0] < textsize[1]: + textsize = (0, 0) + if self["text"].text and textsize[0] < textsize[1]: textsize = (textsize[1], textsize[0] + 10) - if textsize[0] > width: - textsize = (textsize[0], textsize[1] + itemheight) - else: - textsize = (width, textsize[1] + itemheight) - listsize = (textsize[0], itemheight * count) + listLen = len(self.list) + listMaxItems = int((desktop_h * 0.8 - textsize[1]) // itemheight) + scrollbar = self["list"].instance.getScrollbarWidth() + 5 if listLen > listMaxItems else 0 + listWidth = int(min(self["list"].instance.getMaxItemTextWidth() + scrollbar, desktop_w * 0.9)) + count = min(listLen, listMaxItems) + if textsize[0] and textsize[0] < listWidth: + textsize[0] = listWidth + width = max(listWidth, textsize[0]) + listsize = (width, listMaxItems * itemheight) + listPos = separator + (textsize[1] if textsize[1] > 0 else 0) + if self["text"].text: # resize label self["text"].instance.resize(enigma.eSize(*textsize)) - self["text"].instance.move(enigma.ePoint(10, 10)) - # move list - self["list"].instance.move(enigma.ePoint(0, textsize[1])) - self["list"].instance.resize(enigma.eSize(*listsize)) + self["text"].instance.move(enigma.ePoint(margin, margin)) + # move list + self["list"].instance.resize(enigma.eSize(*listsize)) + self["list"].instance.move(enigma.ePoint(margin, listPos)) - wsizex = textsize[0] - wsizey = textsize[1] + listsize[1] + wsizex = margin*2 + width + wsizey = listPos + (count * itemheight) + margin wsize = (wsizex, wsizey) self.instance.resize(enigma.eSize(*wsize)) From 1f357bcf596d862778a7a7cdd336a30511be8730 Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Fri, 20 Oct 2023 00:47:18 +0000 Subject: [PATCH 133/203] PEP8 double aggressive E22, E224, E241, E242 and E27 --- lib/python/Screens/ChoiceBox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py index f9eb6f40b90..52095119d57 100644 --- a/lib/python/Screens/ChoiceBox.py +++ b/lib/python/Screens/ChoiceBox.py @@ -159,7 +159,7 @@ def autoResize(self): self["list"].instance.resize(enigma.eSize(*listsize)) self["list"].instance.move(enigma.ePoint(margin, listPos)) - wsizex = margin*2 + width + wsizex = margin * 2 + width wsizey = listPos + (count * itemheight) + margin wsize = (wsizex, wsizey) self.instance.resize(enigma.eSize(*wsize)) From efd79eed35e70ecb3b6d1b91089ac246fe8461cd Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 20 Oct 2023 11:15:29 +0200 Subject: [PATCH 134/203] [ChoiceBox] fix error on line 143, previously getSize was not read --- lib/python/Screens/ChoiceBox.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py index 52095119d57..301b242fa11 100644 --- a/lib/python/Screens/ChoiceBox.py +++ b/lib/python/Screens/ChoiceBox.py @@ -139,22 +139,23 @@ def autoResize(self): desktop_h = enigma.getDesktop(0).size().height() itemheight = self["list"].getItemHeight() textsize = (0, 0) - if self["text"].text and textsize[0] < textsize[1]: + if self["text"].text: + textsize = self["text"].getSize() + if textsize[0] < textsize[1]: textsize = (textsize[1], textsize[0] + 10) listLen = len(self.list) listMaxItems = int((desktop_h * 0.8 - textsize[1]) // itemheight) scrollbar = self["list"].instance.getScrollbarWidth() + 5 if listLen > listMaxItems else 0 listWidth = int(min(self["list"].instance.getMaxItemTextWidth() + scrollbar, desktop_w * 0.9)) count = min(listLen, listMaxItems) - if textsize[0] and textsize[0] < listWidth: + if textsize[1] and textsize[0] < listWidth: textsize[0] = listWidth width = max(listWidth, textsize[0]) listsize = (width, listMaxItems * itemheight) listPos = separator + (textsize[1] if textsize[1] > 0 else 0) - if self["text"].text: - # resize label - self["text"].instance.resize(enigma.eSize(*textsize)) - self["text"].instance.move(enigma.ePoint(margin, margin)) + # resize label + self["text"].instance.resize(enigma.eSize(*textsize)) + self["text"].instance.move(enigma.ePoint(margin, margin)) # move list self["list"].instance.resize(enigma.eSize(*listsize)) self["list"].instance.move(enigma.ePoint(margin, listPos)) From 10692c657d191539e9caa576b86af4ef0db0a91a Mon Sep 17 00:00:00 2001 From: Orlandoxx <95180049+Orlandoxx@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:36:57 +0300 Subject: [PATCH 135/203] Updated Finnish (fi.po) translation. Streamrelay + some corrections. --- po/fi.po | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/po/fi.po b/po/fi.po index de054b773f0..c6d7fd0d2f2 100644 --- a/po/fi.po +++ b/po/fi.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: enigma2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-27 23:35+0000\n" -"PO-Revision-Date: 2023-10-15 09:11+0300\n" +"PO-Revision-Date: 2023-10-20 13:02+0300\n" "Last-Translator: Orlandox\n" "Language-Team: timoj/Kojo/Samzam/Orlandox\n" "Language: fi\n" @@ -4813,15 +4813,15 @@ msgstr "Hakemisto" #, python-format msgid "Directory %s does not exist." -msgstr "Hakemistoa %s ei löydy." +msgstr "Hakemistoa %s ei ole olemassa." #, python-format msgid "Directory '%s' does not exist." -msgstr "Hakemistoa '%s' ei löydy." +msgstr "Hakemistoa '%s' ei ole olemassa." #, python-format msgid "Directory '%s' is not hard links capable." -msgstr "Hakemistoon '%s' ei voi kirjoittaa." +msgstr "Hakemisto '%s' ei ole kova-linkkeihin kykenevä." #, python-format msgid "Directory '%s' not valid. Partition must be ext or nfs." @@ -13540,7 +13540,7 @@ msgstr "" "Suomenkielinen käännös: timoj, Kojo, Samzam, Orlandox\n" "\n" "Ylläpito : Orlandox\n" -"15.10.2023\n" +"20.10.2023\n" "http://www.huoltovalikko.com" msgid "TS file is too large for ISO9660 level 1!" @@ -18812,7 +18812,7 @@ msgid "Select extra packages folder" msgstr "Valitse lisäohjelmapakettien hakemisto" msgid "Select folder containing plugins(.ipk) and Save" -msgstr "Valitse lisäosia sisältävä hakemisto (.ipk) ja Tallenna" +msgstr "Valitse laajennuksia sisältävä hakemisto (.ipk) ja Tallenna" msgid "Select the SWAP file size:" msgstr "Valitse SWAP:n koko:" @@ -19085,28 +19085,22 @@ msgid "Please select a valid directory." msgstr "Valitse kelvollinen hakemisto." msgid "Play service without streamrelay" -msgstr "Toista kanava ilman stream relay:tä" +msgstr "Toista kanava ilman striimin välitystä" msgid "Play service with streamrelay" -msgstr "Toista kanava stream relay:llä" +msgstr "Toista kanava striimin välityksellä" msgid "Stream relay" -msgstr "Stream relay" - -msgid "Stream relay url" -msgstr "Stream relay -url" - -msgid "Stream relay url will normally be the default" -msgstr "Stream relay -url on normaalisti oletusarvo" +msgstr "Striimin välitys" -msgid "Stream relay port" -msgstr "Stream relay -portti" +msgid "Streamrelay url" +msgstr "Striimin välitys -url" -msgid "Stream relay port will normally be the default" -msgstr "Stream relay -portti on normaalisti oletusarvo" +msgid "The IP address of the streamrelay server that is used to descramble services that can only be decrypted via streamrelay" +msgstr "Striimin välitys -palvelimen IP-osoite, jota käytetään sellaisten palvelujen salauksen purkamiseen, joiden salaus voidaan purkaa vain striimin välityksen kautta" -msgid "Stream relay use dummy namespace" -msgstr "Stream relay, käytä valenimiavaruutta" +msgid "Streamrelay port" +msgstr "Striimin välitys -portti" -msgid "Some binaries require a dummy namespace" -msgstr "Jotkin binäärit vaativat valenimiavaruuden" +msgid "The port of the streamrelay server that is used to descramble services that can only be decrypted via streamrelay" +msgstr "Striimin välitys -palvelimen portti, jota käytetään sellaisten palvelujen salauksen purkamiseen, joiden salaus voidaan purkaa vain striimin välityksen kautta" From afea303fcfb8f17a93604e791b1856dc4a8e3be8 Mon Sep 17 00:00:00 2001 From: Orlandoxx <95180049+Orlandoxx@users.noreply.github.com> Date: Fri, 20 Oct 2023 19:36:36 +0300 Subject: [PATCH 136/203] Updated fi.po Corrections. --- po/fi.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/fi.po b/po/fi.po index c6d7fd0d2f2..da6df2390b9 100644 --- a/po/fi.po +++ b/po/fi.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: enigma2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-27 23:35+0000\n" -"PO-Revision-Date: 2023-10-20 13:02+0300\n" +"PO-Revision-Date: 2023-10-20 19:33+0300\n" "Last-Translator: Orlandox\n" "Language-Team: timoj/Kojo/Samzam/Orlandox\n" "Language: fi\n" @@ -18812,7 +18812,7 @@ msgid "Select extra packages folder" msgstr "Valitse lisäohjelmapakettien hakemisto" msgid "Select folder containing plugins(.ipk) and Save" -msgstr "Valitse laajennuksia sisältävä hakemisto (.ipk) ja Tallenna" +msgstr "Valitse lisäosia (.ipk) sisältävä hakemisto ja Tallenna" msgid "Select the SWAP file size:" msgstr "Valitse SWAP:n koko:" From 13b68814303513814e57031ff0d84a9000c90197 Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 20 Oct 2023 21:05:58 +0200 Subject: [PATCH 137/203] [ChoiceBox] Specify imports, not just import enigma --- lib/python/Screens/ChoiceBox.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py index 301b242fa11..5928376afbb 100644 --- a/lib/python/Screens/ChoiceBox.py +++ b/lib/python/Screens/ChoiceBox.py @@ -6,7 +6,7 @@ from Components.ChoiceList import ChoiceEntryComponent, ChoiceList from Components.Sources.StaticText import StaticText from Tools.BoundFunction import boundFunction -import enigma +from enigma import ePoint, eSize, getDesktop from skin import applySkinFactor config.misc.pluginlist = ConfigSubsection() @@ -134,9 +134,9 @@ def __init__(self, session, title="", list=None, keys=None, selection=0, skin_na def autoResize(self): margin = applySkinFactor(4) - separator = 10 - desktop_w = enigma.getDesktop(0).size().width() - desktop_h = enigma.getDesktop(0).size().height() + separator = applySkinFactor(10) + desktop_w = getDesktop(0).size().width() + desktop_h = getDesktop(0).size().height() itemheight = self["list"].getItemHeight() textsize = (0, 0) if self["text"].text: @@ -149,24 +149,24 @@ def autoResize(self): listWidth = int(min(self["list"].instance.getMaxItemTextWidth() + scrollbar, desktop_w * 0.9)) count = min(listLen, listMaxItems) if textsize[1] and textsize[0] < listWidth: - textsize[0] = listWidth + textsize = (listWidth, textsize[1]) width = max(listWidth, textsize[0]) listsize = (width, listMaxItems * itemheight) listPos = separator + (textsize[1] if textsize[1] > 0 else 0) # resize label - self["text"].instance.resize(enigma.eSize(*textsize)) - self["text"].instance.move(enigma.ePoint(margin, margin)) + self["text"].instance.resize(eSize(*textsize)) + self["text"].instance.move(ePoint(margin, margin)) # move list - self["list"].instance.resize(enigma.eSize(*listsize)) - self["list"].instance.move(enigma.ePoint(margin, listPos)) + self["list"].instance.resize(eSize(*listsize)) + self["list"].instance.move(ePoint(margin, listPos)) wsizex = margin * 2 + width wsizey = listPos + (count * itemheight) + margin wsize = (wsizex, wsizey) - self.instance.resize(enigma.eSize(*wsize)) + self.instance.resize(eSize(*wsize)) # center window - self.instance.move(enigma.ePoint((desktop_w - wsizex) // 2, (desktop_h - wsizey) // 2)) + self.instance.move(ePoint((desktop_w - wsizex) // 2, (desktop_h - wsizey) // 2)) def left(self): if len(self["list"].list) > 0: From 8db78b9e666bfd7f33472fb6be11b3d7a344f2ed Mon Sep 17 00:00:00 2001 From: Huevos Date: Fri, 20 Oct 2023 22:06:37 +0200 Subject: [PATCH 138/203] [MessageBox] rewrite autoresize --- lib/python/Screens/MessageBox.py | 75 ++++++++++++++++---------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index ca217ac2a37..af1bc99f52e 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -8,7 +8,7 @@ from Components.Sources.StaticText import StaticText from Screens.HelpMenu import HelpableScreen from Screens.Screen import Screen -from skin import parseScale +from skin import parseScale, applySkinFactor class MessageBox(Screen, HelpableScreen): @@ -182,46 +182,47 @@ def getPixmapWidth(self): return defaultPixmapWidth def autoResize(self): - # Get the real pixmap width from the skin so this can be used in the formula below. - # Historically the default pixmap width has been 53 + 12 pixels of right margin. - pixmapWidth = self.getPixmapWidth() - pixmapMargin = 12 - itemHeight = self.getListItemHeight() - count = len(self.list) - if not self["text"].text: - textsize = (520, 0) - listsize = (520, itemHeight * count) - if self.picon: - self["list"].instance.move(ePoint(pixmapWidth + pixmapMargin, 0)) - wsizex = textsize[0] + pixmapWidth + pixmapMargin - else: - self["list"].instance.move(ePoint(0, 0)) - wsizex = textsize[0] - self["list"].instance.resize(eSize(*listsize)) - else: + margin = applySkinFactor(4) + separator = applySkinFactor(10) + desktop_w = getDesktop(0).size().width() + desktop_h = getDesktop(0).size().height() + pixmapWidth = 0 + pixmapMargin = 0 + if self.picon: + pixmapWidth = self.getPixmapWidth() + pixmapMargin = applySkinFactor(4) + textsize = (0, 0) + if self["text"].text: textsize = self["text"].getSize() if textsize[0] < textsize[1]: textsize = (textsize[1], textsize[0] + 10) - if textsize[0] > 520: - textBottomMargin = int(1.0 * textsize[0] // 520 * 30) # previously always 25 - textsize = (textsize[0], textsize[1] + textBottomMargin) - else: - textsize = (520, textsize[1] + 25) - listsize = (textsize[0], itemHeight * count) + listLen = len(self.list) + itemheight = self.getListItemHeight() + listMaxItems = int((desktop_h * 0.8 - textsize[1]) // itemheight) + scrollbar = self["list"].instance.getScrollbarWidth() + 5 if listLen > listMaxItems else 0 + listWidth = int(min(self["list"].instance.getMaxItemTextWidth() + scrollbar, desktop_w * 0.9)) + count = min(listLen, listMaxItems) + if textsize[1]: + textsize = (textsize[0] + applySkinFactor(10), textsize[1] + applySkinFactor(2)) + if textsize[0] < listWidth: + textsize = (listWidth, textsize[1]) + width = max(listWidth, textsize[0]) + listsize = (width, listMaxItems * itemheight) + listPos = separator + (textsize[1] if textsize[1] > 0 else 0) + # resize label + self["text"].instance.resize(eSize(*textsize)) + self["text"].instance.move(ePoint(margin + pixmapWidth + pixmapMargin, 0)) + # move list + self["list"].instance.resize(eSize(*listsize)) + self["list"].instance.move(ePoint(margin + pixmapWidth + pixmapMargin, listPos)) - self["text"].instance.resize(eSize(*textsize)) - if self.picon: - self["text"].instance.move(ePoint(pixmapWidth + pixmapMargin, 0)) - self["list"].instance.move(ePoint(pixmapWidth + pixmapMargin, textsize[1])) - wsizex = textsize[0] + pixmapWidth + pixmapMargin - else: - self["text"].instance.move(ePoint(10, 10)) - self["list"].instance.move(ePoint(0, textsize[1])) - wsizex = textsize[0] - self["list"].instance.resize(eSize(*listsize)) - wsizey = textsize[1] + listsize[1] - self.instance.resize(eSize(*(wsizex, wsizey))) - self.instance.move(ePoint((getDesktop(0).size().width() - wsizex) // 2, (getDesktop(0).size().height() - wsizey) // 2)) + wsizex = margin * 2 + width + pixmapWidth + pixmapMargin + wsizey = listPos + (count * itemheight) + margin + wsize = (wsizex, wsizey) + self.instance.resize(eSize(*wsize)) + + # center window + self.instance.move(ePoint((desktop_w - wsizex) // 2, (desktop_h - wsizey) // 2)) def cancel(self): for x in self["list"].list: From 5808e0e8f0fdbb921fc54cd63b65d0a282256683 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 21 Oct 2023 03:57:33 +0200 Subject: [PATCH 139/203] Revert https://github.com/OpenViX/enigma2/commit/e4f0c664f4b44d5d033316676c846e253f0f9a42 because enigma is a house of cards --- lib/python/Components/MenuList.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/python/Components/MenuList.py b/lib/python/Components/MenuList.py index d94f8367e11..cc77325de33 100644 --- a/lib/python/Components/MenuList.py +++ b/lib/python/Components/MenuList.py @@ -7,7 +7,7 @@ def __init__(self, list, enableWrapAround=True, content=eListboxPythonStringCont GUIComponent.__init__(self) self.l = content() self.onSelectionChanged = [] - self.list = list + self.setList(list) self.enableWrapAround = enableWrapAround def getCurrent(self): @@ -36,15 +36,10 @@ def getSelectedIndex(self): return self.l.getCurrentSelectionIndex() def setList(self, list): - self.__list = list - self.l.setList(self.__list) + self.list = list + self.l.setList(self.list) self.selectionChanged() - def getList(self): - return self.__list - - list = property(getList, setList) - def moveToIndex(self, idx): if self.instance is not None: self.instance.moveSelectionTo(idx) From c9f616aa26888b60be2a102e4dc14bb9c4238629 Mon Sep 17 00:00:00 2001 From: Pr0metheus Date: Fri, 20 Oct 2023 11:13:38 +0200 Subject: [PATCH 140/203] Update sk.po --- po/sk.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/sk.po b/po/sk.po index 5adef1de86a..b7cc723eaab 100644 --- a/po/sk.po +++ b/po/sk.po @@ -16774,11 +16774,11 @@ msgstr "Žlté DVB titulky" #, fuzzy msgid "Yellow button (long)" -msgstr "Tlacidlo info (dlho)" +msgstr "Žlté tlačidlo (dlho)" #, fuzzy msgid "Yellow button (short)" -msgstr "Tlacidlo info (krátko)" +msgstr "Žlté tlačidlo (krátko)" msgid "Yellow long" msgstr "" From 3736e62249d36856ff6672e38907c51ffc6cc0df Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Mon, 23 Oct 2023 13:04:03 +0300 Subject: [PATCH 141/203] - fix messagebox crash due to missing warning pixmap --- lib/python/Screens/MessageBox.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index af1bc99f52e..2124f736ae2 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -63,6 +63,8 @@ def __init__(self, session, text, type=TYPE_YESNO, timeout=0, close_on_any_key=F self["InfoPixmap"].hide() self["ErrorPixmap"] = Pixmap() self["ErrorPixmap"].hide() + self["WarningPixmap"] = Pixmap() + self["WarningPixmap"].hide() self["icon"] = MultiPixmap() self["icon"].hide() self.picon = picon @@ -74,6 +76,8 @@ def __init__(self, session, text, type=TYPE_YESNO, timeout=0, close_on_any_key=F self["InfoPixmap"].show() elif self.type == self.TYPE_ERROR: self["ErrorPixmap"].show() + elif self.type == self.TYPE_WARNING: + self["WarningPixmap"].show() self["icon"].show() self.skinName = ["MessageBox"] if simple: From 2449adff3e621d8552128ebaefbd3a69b354abe9 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Mon, 23 Oct 2023 13:36:01 +0300 Subject: [PATCH 142/203] - add warning pixmap to guarding check --- lib/python/Screens/MessageBox.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index 2124f736ae2..aa0b32d4679 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -180,6 +180,7 @@ def getPixmapWidth(self): return self["ErrorPixmap"].visible and hasattr(self["ErrorPixmap"], 'getSize') and isinstance(self["ErrorPixmap"].getSize(), tuple) and len(self["ErrorPixmap"].getSize()) and self["ErrorPixmap"].getSize()[0] or \ self["QuestionPixmap"].visible and hasattr(self["QuestionPixmap"], 'getSize') and isinstance(self["QuestionPixmap"].getSize(), tuple) and len(self["QuestionPixmap"].getSize()) and self["QuestionPixmap"].getSize()[0] or \ self["InfoPixmap"].visible and hasattr(self["InfoPixmap"], 'getSize') and isinstance(self["InfoPixmap"].getSize(), tuple) and len(self["InfoPixmap"].getSize()) and self["InfoPixmap"].getSize()[0] or \ + self["WarningPixmap"].visible and hasattr(self["WarningPixmap"], 'getSize') and isinstance(self["WarningPixmap"].getSize(), tuple) and len(self["WarningPixmap"].getSize()) and self["WarningPixmap"].getSize()[0] or \ defaultPixmapWidth except Exception as err: print("[MessageBox] defaultPixmapWidth, %s: '%s'" % (type(err).__name__, err)) From 96871f44e51050804c82c36bcb8a6d2b27e34da1 Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Mon, 23 Oct 2023 14:01:45 +0300 Subject: [PATCH 143/203] - added selection image for AudioSelectionScreen --- lib/python/Screens/AudioSelection.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/python/Screens/AudioSelection.py b/lib/python/Screens/AudioSelection.py index a844c634275..956dd43515a 100644 --- a/lib/python/Screens/AudioSelection.py +++ b/lib/python/Screens/AudioSelection.py @@ -20,8 +20,8 @@ from Tools.ISO639 import LanguageCodes from Tools.General import isIPTV -# from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN -# from Tools.LoadPixmap import LoadPixmap +from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN +from Tools.LoadPixmap import LoadPixmap from pickle import load as pickle_load, dump as pickle_dump, dumps as pickle_dumps from os import path as os_path @@ -32,7 +32,7 @@ CONFIG_FILE_AV = '/etc/enigma2/config_av' -# selectionpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "selections/selectioncross.png")) # for use in the future +selectionpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "selections/selectioncross.png")) # for use in the future def getAVDict(): @@ -338,7 +338,7 @@ def fillList(self, arg=None): else: language += lang cnt += 1 - streams.append((x, "", number, description, language, selected)) + streams.append((x, "", number, description, language, selected, selectionpng if selected == "X" else None)) else: conflist.append(("",)) if SystemInfo["Canedidchecking"]: @@ -393,7 +393,7 @@ def __call__(self, *args, **kwargs): except Exception: description = _("unknown") + ": %s" % x[2] number = str(int(number) + 1) - streams.append((x, "", number, description, language, selected)) + streams.append((x, "", number, description, language, selected, selectionpng if selected == "X" else None)) idx += 1 conflist.append(getConfigListEntry(_("To audio selection"), self.settings.menupage)) From 4f621ce30d9332a5073b269992ce398f5e70f5fb Mon Sep 17 00:00:00 2001 From: openvix-build Date: Mon, 23 Oct 2023 11:34:26 +0000 Subject: [PATCH 144/203] openvix: developer 6.4.009.002 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 14829f7e833..f52dc79e425 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1185,3 +1185,4 @@ openvix: developer 6.4.008.011 openvix: developer 6.4.008.012 openvix: developer 6.4.008.013 openvix: developer 6.4.009.001 +openvix: developer 6.4.009.002 From d04f25fb2b3841125104effb54136f6289f8d798 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:04:51 +0200 Subject: [PATCH 145/203] [Skin] - remove unused SCOPE's CONFIG & SKIN_IMAGE - remove PEP8 on variable c --- lib/python/skin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/skin.py b/lib/python/skin.py index d53aee14374..c53690c9f73 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -6,7 +6,7 @@ from Components.config import ConfigSubsection, ConfigText, config from Components.Sources.Source import ObsoleteSource from Components.SystemInfo import SystemInfo -from Tools.Directories import SCOPE_CONFIG, SCOPE_CURRENT_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_FONTS, SCOPE_SKIN, SCOPE_SKIN_IMAGE, resolveFilename, fileReadXML, clearResolveLists +from Tools.Directories import SCOPE_CURRENT_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_FONTS, SCOPE_SKIN, resolveFilename, fileReadXML, clearResolveLists from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap @@ -236,7 +236,7 @@ def parseCoordinate(s, e, size=0, font=None): if "center" in s: center = (e - size) / 2.0 # noqa: F841 if "c" in s: - c = e / 2.0 + c = e / 2.0 # noqa: F841 do not remove c variable if "w" in s: s = s.replace("w", "*w") w = float(font in fonts and fonts[font][3] or 0) # noqa: F841 From b807a7cf32f271b8725306a1708c83450c9d66b6 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:09:39 +0200 Subject: [PATCH 146/203] [StartEnigma] - PEP8 kill import not at top complaints --- lib/python/StartEnigma.py | 53 ++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index d8853656805..39416d91416 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -335,7 +335,7 @@ def runScreenTest(): screensToRun = [p.fnc for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD)] profile("wizards") - screensToRun += wizardManager.getWizards() + screensToRun += wizardManager.getWizards() # noqa: F405 screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() @@ -359,9 +359,9 @@ def runNextScreen(session, screensToRun, *result): if not VuRecovery: profile("Init:VolumeControl") - vol = VolumeControl(session) #noqa: F841 + vol = VolumeControl(session) # noqa: F841 profile("Init:PowerKey") - power = PowerKey(session) #noqa: F841 + power = PowerKey(session) # noqa: F841 if enigma.eAVSwitch.getInstance().haveScartSwitch(): # we need session.scart to access it from within menu.xml @@ -457,7 +457,7 @@ def runNextScreen(session, screensToRun, *result): InitSetupDevices() if getImageArch() in ("aarch64"): - from usb.backend import libusb1 + from usb.backend import libusb1 # noqa: E402 libusb1.get_backend(find_library=lambda x: "/lib64/libusb-1.0.so.0") @@ -470,7 +470,7 @@ def runNextScreen(session, screensToRun, *result): print("[StartEnigma] Initialising InfoBar.") from Screens import InfoBar # noqa: E402 -from Components.SystemInfo import SystemInfo # noqa: E402 # don't move this import +from Components.SystemInfo import SystemInfo # noqa: E402 don't move this import VuRecovery = SystemInfo["HasKexecMultiboot"] and SystemInfo["MultiBootSlot"] == 0 # print("[StartEnigma] Is this VuRecovery?. Recovery = ", VuRecovery) @@ -526,11 +526,11 @@ def setLoadUnlinkedUserbouquets(configElement): profile("Twisted") print("[StartEnigma] Initialising Twisted.") try: - import twisted.python.runtime + import twisted.python.runtime # noqa: E402 twisted.python.runtime.platform.supportsThreads = lambda: True - import e2reactor + import e2reactor # noqa: E402 e2reactor.install() - from twisted.internet import reactor + from twisted.internet import reactor # noqa: E402 def runReactor(): reactor.run(installSignalHandlers=False) @@ -544,7 +544,7 @@ def runReactor(): profile("Twisted Log") print("[StartEnigma] Initialising Twisted Log.") try: - from twisted.python import log, util + from twisted.python import log, util # noqa: E402 def quietEmit(self, eventDict): text = log.textFromEventDict(eventDict) @@ -577,7 +577,7 @@ def quietEmit(self, eventDict): profile("LOAD:Wizard") print("[StartEnigma] Initialising Wizards.") -from Screens.StartWizard import * # import *' used; unable to detect undefined names +from Screens.StartWizard import * # noqa: F403,E402 profile("LOAD:Plugin") print("[StartEnigma] Initialising Plugins.") @@ -613,31 +613,32 @@ def quietEmit(self, eventDict): def RCSelectionChanged(configelement): - from Components.SystemInfo import setRCFile + from Components.SystemInfo import setRCFile # noqa: E402 setRCFile(configelement.value) config.misc.RCSource.addNotifier(RCSelectionChanged, immediate_feedback=False) -profile("Standby,PowerKey") +profile("Standby") import Screens.Standby # noqa: E402 + from Screens.Menu import MainMenu, mdom # noqa: E402 from GlobalActions import globalActionMap # noqa: E402 if enigma.eAVSwitch.getInstance().haveScartSwitch(): profile("Scart") print("[StartEnigma] Initialising Scart.") - from Screens.Scart import Scart + from Screens.Scart import Scart # noqa: E402 if not VuRecovery: profile("Load:CI") print("[StartEnigma] Initialising CommonInterface.") - from Screens.Ci import CiHandler + from Screens.Ci import CiHandler # noqa: E402 profile("Load:VolumeControl") print("[StartEnigma] Initialising VolumeControl.") - from Components.VolumeControl import VolumeControl - from Tools.StbHardware import setFPWakeuptime, setRTCtime + from Components.VolumeControl import VolumeControl # noqa: E402 + from Tools.StbHardware import setFPWakeuptime, setRTCtime # noqa: E402 profile("Init:skin") print("[StartEnigma] Initialising Skins.") @@ -669,7 +670,7 @@ def RCSelectionChanged(configelement): if not VuRecovery: profile("RecordingConfig") print("[StartEnigma] Initialising RecordingConfig.") - from Components.RecordingConfig import InitRecordingConfig + from Components.RecordingConfig import InitRecordingConfig # noqa: E402 InitRecordingConfig() profile("UsageConfig") @@ -698,47 +699,47 @@ def RCSelectionChanged(configelement): else: profile("Init:OnlineCheckState") print("[StartEnigma] Initialising OnlineCheckState.") - from Components.OnlineUpdateCheck import OnlineUpdateCheck + from Components.OnlineUpdateCheck import OnlineUpdateCheck # noqa: E402 OnlineUpdateCheck() profile("Network") print("[StartEnigma] Initialising Network.") - from Components.Network import InitNetwork + from Components.Network import InitNetwork # noqa: E402 InitNetwork() profile("HdmiCec") print("[StartEnigma] Initialising hdmiCEC.") - from Components.HdmiCec import HdmiCec + from Components.HdmiCec import HdmiCec # noqa: E402 HdmiCec() profile("LCD") print("[StartEnigma] Initialising LCD / FrontPanel.") - from Components.Lcd import InitLcd + from Components.Lcd import InitLcd # noqa: E402 InitLcd() profile("UserInterface") print("[StartEnigma] Initialising UserInterface.") - from Screens.UserInterfacePositioner import InitOsdPosition + from Screens.UserInterfacePositioner import InitOsdPosition # noqa: E402 InitOsdPosition() profile("EpgCacheSched") print("[StartEnigma] Initialising EPGCacheScheduler.") - from Components.EpgLoadSave import EpgCacheLoadCheck, EpgCacheSaveCheck + from Components.EpgLoadSave import EpgCacheLoadCheck, EpgCacheSaveCheck # noqa: E402 EpgCacheSaveCheck() EpgCacheLoadCheck() profile("RFMod") print("[StartEnigma] Initialising RFMod.") - from Components.RFmod import InitRFmod + from Components.RFmod import InitRFmod # noqa: E402 InitRFmod() profile("Init:CI") print("[StartEnigma] Initialising CommonInterface.") - from Screens.Ci import InitCiConfig + from Screens.Ci import InitCiConfig # noqa: E402 InitCiConfig() if config.clientmode.enabled.value: - import Components.ChannelsImporter + import Components.ChannelsImporter # noqa: E402 Components.ChannelsImporter.autostart() From 54ea6f3234effb262c766425eaecc6d5622d88a9 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:12:33 +0200 Subject: [PATCH 147/203] [RecordTimer] - kill PEP8 complaints --- lib/python/RecordTimer.py | 41 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/lib/python/RecordTimer.py b/lib/python/RecordTimer.py index 802de4ce302..a47b237a260 100644 --- a/lib/python/RecordTimer.py +++ b/lib/python/RecordTimer.py @@ -731,8 +731,7 @@ def activate(self): from Components.Converter.ClientsStreaming import ClientsStreaming if (not Screens.Standby.inStandby and NavigationInstance.instance.getCurrentlyPlayingServiceReference() and ("0:0:0:0:0:0:0:0:0" in NavigationInstance.instance.getCurrentlyPlayingServiceReference().toString() or - "4097:" in NavigationInstance.instance.getCurrentlyPlayingServiceReference().toString()) - ): + "4097:" in NavigationInstance.instance.getCurrentlyPlayingServiceReference().toString())): return True if self.afterEvent == AFTEREVENT.STANDBY or (not wasRecTimerWakeup and self.autostate and self.afterEvent == AFTEREVENT.AUTO) or self.wasInStandby: @@ -753,7 +752,7 @@ def activate(self): if int(ClientsStreaming("NUMBER").getText()) > 0: if not Screens.Standby.inStandby: # not already in standby Notifications.AddNotificationWithCallback(self.sendStandbyNotification, MessageBox, - _("A finished record timer wants to set your\n%s %s to standby. Do that now?") % (getMachineBrand(), getMachineName()) + _("A finished record timer wants to set your\n%s %s to standby. Do that now?") % (getMachineBrand(), getMachineName()) + _("\n(DeepStandby request changed to Standby owing to there being streaming clients.)"), timeout=180) return True @@ -889,7 +888,7 @@ def getNextActivation(self): def failureCB(self, answer): if answer: self.log(13, "ok, zapped away") - #NavigationInstance.instance.stopUserServices() + # NavigationInstance.instance.stopUserServices() self._bouquet_search() if not self.first_try_prepare and self.InfoBarInstance and hasattr(self.InfoBarInstance.session, "pipshown") and self.InfoBarInstance.session.pipshown: hasattr(self.InfoBarInstance, "showPiP") and self.InfoBarInstance.showPiP() @@ -971,7 +970,7 @@ def createTimer(xml): "standby": AFTEREVENT.STANDBY, "deepstandby": AFTEREVENT.DEEPSTANDBY, "auto": AFTEREVENT.AUTO - }[afterevent] + }[afterevent] # noqa: E123 eitx = xml.get("eit") eit = int(eitx) if eitx else None locationx = xml.get("location") @@ -1137,21 +1136,21 @@ def saveTimer(self): ' descramble="%d"' ' record_ecm="%d"' ' isAutoTimer="%d"' % ( - int(entry.begin), - int(entry.end), - stringToXML(str(entry.service_ref)), - int(entry.repeated), - int(entry.rename_repeat), - stringToXML(entry.name), - stringToXML(entry.description), - afterEvents[entry.afterEvent], - int(entry.justplay), - int(entry.always_zap), - int(entry.pipzap), - int(entry.conflict_detection), - int(entry.descramble), - int(entry.record_ecm), - int(entry.isAutoTimer))) + int(entry.begin), + int(entry.end), + stringToXML(str(entry.service_ref)), + int(entry.repeated), + int(entry.rename_repeat), + stringToXML(entry.name), + stringToXML(entry.description), + afterEvents[entry.afterEvent], + int(entry.justplay), + int(entry.always_zap), + int(entry.pipzap), + int(entry.conflict_detection), + int(entry.descramble), + int(entry.record_ecm), + int(entry.isAutoTimer))) if entry.eit is not None: list.append(' eit="' + str(entry.eit) + '"') if entry.dirname: @@ -1286,7 +1285,7 @@ def record(self, entry, ignoreTSC=False, dosave=True, loadtimer=False, justLoad= entry.begin += 1 entry.conflict_detection = real_cd entry.timeChanged() - print("[Timer] Record %s" % entry) + # print("[Timer] Record %s" % entry) entry.Timer = self self.addTimerEntry(entry) From b67212f9c1de7c24566c1dd2fba7d09488d3c3b7 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:16:23 +0200 Subject: [PATCH 148/203] [PowerTimer] - PEP8 cleanup --- lib/python/PowerTimer.py | 66 ++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/lib/python/PowerTimer.py b/lib/python/PowerTimer.py index b621f01deb0..13e260e49cf 100644 --- a/lib/python/PowerTimer.py +++ b/lib/python/PowerTimer.py @@ -199,19 +199,12 @@ def activate(self): # to make it clearer what each test is. # from Components.Converter.ClientsStreaming import ClientsStreaming - if ((not Screens.Standby.inStandby and NavigationInstance.instance.getCurrentlyPlayingServiceReference() and - ('0:0:0:0:0:0:0:0:0' in NavigationInstance.instance.getCurrentlyPlayingServiceReference().toString() or - '4097:' in NavigationInstance.instance.getCurrentlyPlayingServiceReference().toString() - ) or - (int(ClientsStreaming("NUMBER").getText()) > 0) - ) or - (NavigationInstance.instance.RecordTimer.isRecording() or - abs(NavigationInstance.instance.RecordTimer.getNextRecordingTime() - time()) <= 900 or - abs(NavigationInstance.instance.RecordTimer.getNextZapTime() - time()) <= 900) or - (self.autosleepinstandbyonly == 'yes' and not Screens.Standby.inStandby) or - (self.autosleepinstandbyonly == 'yes' and Screens.Standby.inStandby and internalHDDNotSleeping() - ) - ): + if ((not Screens.Standby.inStandby and NavigationInstance.instance.getCurrentlyPlayingServiceReference() and ('0:0:0:0:0:0:0:0:0' in NavigationInstance.instance.getCurrentlyPlayingServiceReference().toString() or + '4097:' in NavigationInstance.instance.getCurrentlyPlayingServiceReference().toString()) or (int(ClientsStreaming("NUMBER").getText()) > 0)) or + (NavigationInstance.instance.RecordTimer.isRecording() or abs(NavigationInstance.instance.RecordTimer.getNextRecordingTime() - time()) <= 900 or + abs(NavigationInstance.instance.RecordTimer.getNextZapTime() - time()) <= 900) or + (self.autosleepinstandbyonly == 'yes' and not Screens.Standby.inStandby) or + (self.autosleepinstandbyonly == 'yes' and Screens.Standby.inStandby and internalHDDNotSleeping())): self.do_backoff() # retry return False @@ -370,7 +363,7 @@ def createTimer(xml): "deepstandby": TIMERTYPE.DEEPSTANDBY, "reboot": TIMERTYPE.REBOOT, "restart": TIMERTYPE.RESTART - }[timertype] + }[timertype] # noqa: E123 begin = int(xml.get("begin")) end = int(xml.get("end")) repeated = str(xml.get("repeated")) @@ -381,7 +374,7 @@ def createTimer(xml): "wakeuptostandby": AFTEREVENT.WAKEUPTOSTANDBY, "standby": AFTEREVENT.STANDBY, "deepstandby": AFTEREVENT.DEEPSTANDBY - }[afterevent] + }[afterevent] # noqa: E123 autosleepinstandbyonly = str(xml.get("autosleepinstandbyonly") or "no") autosleepdelay = str(xml.get("autosleepdelay") or "0") autosleeprepeat = str(xml.get("autosleeprepeat") or "once") @@ -508,25 +501,26 @@ def saveTimer(self): for timer in self.timer_list + self.processed_timers: if timer.dontSave: continue - list.append('\n') @@ -582,7 +576,7 @@ def isNextPowerManagerAfterEventActionAuto(self): def record(self, entry, ignoreTSC=False, dosave=True): # as called by loadTimer with dosave=False entry.timeChanged() - print("[PowerTimer]", str(entry)) + # print("[PowerTimer]", str(entry)) entry.Timer = self self.addTimerEntry(entry) if dosave: @@ -590,7 +584,7 @@ def record(self, entry, ignoreTSC=False, dosave=True): # as called by loadTimer return None def removeEntry(self, entry): - print("[PowerTimer] Remove", str(entry)) + # print("[PowerTimer] Remove", str(entry)) # avoid re-enqueuing entry.repeated = False From 8c60a447312f0bb8f438268203ee8cd02937e3f5 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:18:45 +0200 Subject: [PATCH 149/203] [PowerTimer] - variable l PEP8 cleanup --- lib/python/PowerTimer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/python/PowerTimer.py b/lib/python/PowerTimer.py index 13e260e49cf..9a3f70bd030 100644 --- a/lib/python/PowerTimer.py +++ b/lib/python/PowerTimer.py @@ -397,11 +397,11 @@ def createTimer(xml): else: entry.repeated = int(repeated) - for l in xml.findall("log"): - ltime = int(l.get("time")) - lcode = int(l.get("code")) - # print("[PowerManager]: ltext, time, code", l.text, " ", l.get("time"), " ", l.get("code")) - msg = l.text.strip() + for lxml in xml.findall("log"): + ltime = int(lxml.get("time")) + lcode = int(lxml.get("code")) + # print("[PowerManager]: ltext, time, code", l.text, " ", lxml.get("time"), " ", lxml.get("code")) + msg = lxml.text.strip() entry.log_entries.append((ltime, lcode, msg)) return entry From 9543b74ab7cf5f48cef4c75feae3ff20b5e2f4cb Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:22:31 +0200 Subject: [PATCH 150/203] [PowerTimer] - only import os functions and sort imports --- lib/python/PowerTimer.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/python/PowerTimer.py b/lib/python/PowerTimer.py index 9a3f70bd030..b00c7d55227 100644 --- a/lib/python/PowerTimer.py +++ b/lib/python/PowerTimer.py @@ -1,8 +1,9 @@ -import os -from boxbranding import getMachineBrand, getMachineName -from time import ctime, time +from os import fsync, path as ospath, remove, rename from bisect import insort +from time import ctime, time +from timer import Timer, TimerEntry +from boxbranding import getMachineBrand, getMachineName from enigma import eActionMap, quitMainloop from Components.config import config @@ -12,7 +13,6 @@ import Screens.Standby from Tools import Directories, Notifications from Tools.XMLTools import stringToXML -from timer import Timer, TimerEntry import NavigationInstance @@ -144,9 +144,9 @@ def activate(self): elif next_state == self.StateRunning: self.wasPowerTimerWakeup = False - if os.path.exists("/tmp/was_powertimer_wakeup"): + if ospath.exists("/tmp/was_powertimer_wakeup"): self.wasPowerTimerWakeup = int(open("/tmp/was_powertimer_wakeup", "r").read()) and True or False - os.remove("/tmp/was_powertimer_wakeup") + remove("/tmp/was_powertimer_wakeup") # if this timer has been cancelled, just go to "end" state. if self.cancelled: return True @@ -535,9 +535,9 @@ def saveTimer(self): file.writelines(list) file.flush() - os.fsync(file.fileno()) + fsync(file.fileno()) file.close() - os.rename(self.Filename + ".writing", self.Filename) + rename(self.Filename + ".writing", self.Filename) def getNextZapTime(self): now = time() From df021d43b73a3ff1606d5abeb43fcd5ff189d59e Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:25:12 +0200 Subject: [PATCH 151/203] [NavigationInstance] - remove blank line --- lib/python/NavigationInstance.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/python/NavigationInstance.py b/lib/python/NavigationInstance.py index d2cc8a9828d..17e4207c0fa 100644 --- a/lib/python/NavigationInstance.py +++ b/lib/python/NavigationInstance.py @@ -1,2 +1 @@ - instance = None From ecec9e3eafc4f3800d760b565aa70c8ce676d264 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:39:35 +0200 Subject: [PATCH 152/203] [VideoMode] - remove indents, unused variables etc PEP8 --- lib/python/Screens/VideoMode.py | 43 ++++++++++++--------------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/lib/python/Screens/VideoMode.py b/lib/python/Screens/VideoMode.py index 9fc102db8b0..f3b735d0f5e 100644 --- a/lib/python/Screens/VideoMode.py +++ b/lib/python/Screens/VideoMode.py @@ -5,6 +5,7 @@ from Screens.Screen import Screen from Screens.ChannelSelection import FLAG_IS_DEDICATED_3D from Components.About import about +from Components.ActionMap import ActionMap from Components.SystemInfo import SystemInfo from Components.ConfigList import ConfigListScreen from Components.config import config, configfile, getConfigListEntry @@ -38,12 +39,8 @@ def __init__(self, session): self.list = [] ConfigListScreen.__init__(self, self.list, session=session, on_change=self.changedEntry, fullUI=True) - from Components.ActionMap import ActionMap self["actions"] = ActionMap(["SetupActions"], - { - "save": self.apply, - }, -2) - + {"save": self.apply, }, -2) self["description"] = Label("") self.createSetup() self.grabLastGoodMode() @@ -251,18 +248,18 @@ def __init__(self, session): self.detecttimer.callback.append(self.VideoChangeDetect) def checkIfDedicated3D(self): - service = self.session.nav.getCurrentlyPlayingServiceReference() - servicepath = service and service.getPath() - if servicepath and servicepath.startswith("/"): - if service.toString().startswith("1:"): - info = eServiceCenter.getInstance().info(service) - service = info and info.getInfoString(service, iServiceInformation.sServiceref) - return service and eDVBDB.getInstance().getFlag(eServiceReference(service)) & FLAG_IS_DEDICATED_3D == FLAG_IS_DEDICATED_3D and "sidebyside" - else: - return ".3d." in servicepath.lower() and "sidebyside" or ".tab." in servicepath.lower() and "topandbottom" - service = self.session.nav.getCurrentService() - info = service and service.info() - return info and info.getInfo(iServiceInformation.sIsDedicated3D) == 1 and "sidebyside" + service = self.session.nav.getCurrentlyPlayingServiceReference() + servicepath = service and service.getPath() + if servicepath and servicepath.startswith("/"): + if service.toString().startswith("1:"): + info = eServiceCenter.getInstance().info(service) + service = info and info.getInfoString(service, iServiceInformation.sServiceref) + return service and eDVBDB.getInstance().getFlag(eServiceReference(service)) & FLAG_IS_DEDICATED_3D == FLAG_IS_DEDICATED_3D and "sidebyside" + else: + return ".3d." in servicepath.lower() and "sidebyside" or ".tab." in servicepath.lower() and "topandbottom" + service = self.session.nav.getCurrentService() + info = service and service.info() + return info and info.getInfo(iServiceInformation.sIsDedicated3D) == 1 and "sidebyside" def __evStart(self): if config.osd.threeDmode.value == "auto": @@ -305,13 +302,6 @@ def VideoChangeDetect(self): current_mode = fd.read()[:-1].replace("\n", "") if current_mode.upper() in ("PAL", "NTSC"): current_mode = current_mode.upper() - current_pol = "" - if "i" in current_mode: - current_pol = "i" - elif "p" in current_mode: - current_pol = "p" - current_res = current_pol and current_mode.split(current_pol)[0].replace("\n", "") or "" - current_rate = current_pol and current_mode.split(current_pol)[0].replace("\n", "") and current_mode.split(current_pol)[1].replace("\n", "") or "" video_height = None video_width = None video_pol = None @@ -384,8 +374,7 @@ def VideoChangeDetect(self): new_pol = str(video_pol) else: new_pol = config_pol - write_mode = None - new_mode = None + write_mode = new_mode = None if config_mode in ("PAL", "NTSC"): write_mode = config_mode elif config.av.autores.value == "all" or (config.av.autores.value == "hd" and int(new_res) >= 720): @@ -449,7 +438,7 @@ def VideoChangeDetect(self): else: write_mode = current_mode except IOError: - write_mode = current_mode + write_mode = current_mode if write_mode and current_mode != write_mode: resolutionlabel["restxt"].setText(_("Video mode: %s") % write_mode) if config.av.autores.value != "disabled" and config.av.autores_label_timeout.value != "0": From 70e88f5a6a11e2d12b809efcc20bd7cbd3849b52 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:42:09 +0200 Subject: [PATCH 153/203] [UserInterfacePositioner] PEP8 cleanup --- lib/python/Screens/UserInterfacePositioner.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/Screens/UserInterfacePositioner.py b/lib/python/Screens/UserInterfacePositioner.py index 1bef7ca0c84..e97f495fe0c 100644 --- a/lib/python/Screens/UserInterfacePositioner.py +++ b/lib/python/Screens/UserInterfacePositioner.py @@ -71,7 +71,7 @@ def InitOsdPosition(): SystemInfo["CanChangeOsdPosition"] = access('/proc/stb/fb/dst_left', R_OK) and True or False SystemInfo["OsdSetup"] = SystemInfo["CanChangeOsdPosition"] - if SystemInfo["CanChangeOsdAlpha"] == True or SystemInfo["CanChangeOsdPosition"] == True: + if SystemInfo["CanChangeOsdAlpha"] is True or SystemInfo["CanChangeOsdPosition"] is True: SystemInfo["OsdMenu"] = True else: SystemInfo["OsdMenu"] = False @@ -118,8 +118,8 @@ def __init__(self, session): self["actions"] = ActionMap(["ColorActions"], { "yellow": self.keyDefault, - }, -2) - + }, -2) # noqa: E123 + self.alpha = config.osd.alpha.value self.onChangedEntry = [] self.list = [] ConfigListScreen.__init__(self, self.list, session=self.session, on_change=self.changedEntry, fullUI=True) @@ -212,7 +212,7 @@ def setPreviewPosition(self): def __onClose(self): self.ConsoleB.ePopen('/usr/bin/showiframe /usr/share/backdrop.mvi') -# This is called by the Wizard... + # This is called by the Wizard... def run(self): config.osd.dst_left.save() From 5fd4ff0c445a8670cba9158d20ef03234c32fe41 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:43:14 +0200 Subject: [PATCH 154/203] [TimerSelection] - PEP8 cleanup --- lib/python/Screens/TimerSelection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/TimerSelection.py b/lib/python/Screens/TimerSelection.py index d91590a8f3b..0d67219b985 100644 --- a/lib/python/Screens/TimerSelection.py +++ b/lib/python/Screens/TimerSelection.py @@ -16,7 +16,7 @@ def __init__(self, session, list): { "ok": self.selected, "cancel": self.leave, - }, -1) + }, -1) # noqa: E123 def leave(self): self.close(None) From a6adf3697e5049d67b6e530b14bc3906776ca904 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:44:34 +0200 Subject: [PATCH 155/203] [TimerEntryBase] - PEP8 cleanup --- lib/python/Screens/TimerEntryBase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/TimerEntryBase.py b/lib/python/Screens/TimerEntryBase.py index 1d1272d4c9c..a3ec4b6e1cb 100644 --- a/lib/python/Screens/TimerEntryBase.py +++ b/lib/python/Screens/TimerEntryBase.py @@ -56,7 +56,7 @@ def createConfig(self): count = 0 for x in (0, 1, 2, 3, 4, 5, 6): if flags == 1: # weekly -# print("[TimerEntryBase] Set to weekday " + str(x)) + # print("[TimerEntryBase] Set to weekday " + str(x)) weekday = x if flags & 1 == 1: # set user defined flags day[x] = 1 From dbd018053fd78772e09a77a4e1800ae145f0e492 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:47:43 +0200 Subject: [PATCH 156/203] [TimerEntry] - fix indented code, unused imports, PEP8 complaints --- lib/python/Screens/TimerEntry.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py index 17ffda5011f..8f7cb749301 100644 --- a/lib/python/Screens/TimerEntry.py +++ b/lib/python/Screens/TimerEntry.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- - -from time import localtime, time, strftime +from time import time from enigma import eEPGCache @@ -36,7 +35,7 @@ def createConfig(self): AFTEREVENT.DEEPSTANDBY: "deepstandby", AFTEREVENT.STANDBY: "standby", AFTEREVENT.AUTO: "auto" - }[self.timer.afterEvent] + }[self.timer.afterEvent] # noqa: E123 if self.timer.record_ecm and self.timer.descramble: recordingtype = "descrambled+ecm" @@ -59,10 +58,10 @@ def createConfig(self): self.timerentry_tags = self.timer.tags[:] # if no tags found, make name of event default tag set. if not self.timerentry_tags: - tagname = self.timer.name.strip() - if tagname: - tagname = tagname[0].upper() + tagname[1:].replace(" ", "_") - self.timerentry_tags.append(tagname) + tagname = self.timer.name.strip() + if tagname: + tagname = tagname[0].upper() + tagname[1:].replace(" ", "_") + self.timerentry_tags.append(tagname) self.timerentry_tagsset = ConfigSelection(choices=[not self.timerentry_tags and "None" or " ".join(self.timerentry_tags)]) @@ -161,10 +160,9 @@ def getBeginEnd(self): def selectChannelSelector(self, *args): self.session.openWithCallback( - self.finishedChannelSelectionCorrection, - Screens.ChannelSelection.SimpleChannelSelection, - _("Select channel to record from") - ) + self.finishedChannelSelectionCorrection, + Screens.ChannelSelection.SimpleChannelSelection, + _("Select channel to record from")) def finishedChannelSelectionCorrection(self, *args): if args: @@ -190,7 +188,7 @@ def keySave(self, result=None): "deepstandby": AFTEREVENT.DEEPSTANDBY, "standby": AFTEREVENT.STANDBY, "auto": AFTEREVENT.AUTO - }[self.timerentry_afterevent.value] + }[self.timerentry_afterevent.value] # noqa: E123 # There is no point doing anything after a Zap-only timer! # For a start, you can't actually configure anything in the menu, but # leaving it as AUTO means that the code may try to shutdown at Zap time @@ -202,12 +200,12 @@ def keySave(self, result=None): "normal": True, "descrambled+ecm": True, "scrambled+ecm": False, - }[self.timerentry_recordingtype.value] + }[self.timerentry_recordingtype.value] # noqa: E123 self.timer.record_ecm = { "normal": False, "descrambled+ecm": True, "scrambled+ecm": True, - }[self.timerentry_recordingtype.value] + }[self.timerentry_recordingtype.value] # noqa: E123 self.timer.service_ref = self.timerentry_service_ref self.timer.tags = self.timerentry_tags From 8b1372b6dd886d61b6ffe1ea4b75e3c998818a80 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:49:45 +0200 Subject: [PATCH 157/203] [TimerEdit] - PEP8 complaints --- lib/python/Screens/TimerEdit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 40531e5f9ac..019f12cb35a 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -68,7 +68,7 @@ def __init__(self, session, selectItem=None): "moveTop": self.moveTop, "moveEnd": self.moveEnd, "menu": self.createSetup - }, -1) + }, -1) # noqa: E123 self.session.nav.RecordTimer.on_state_change.append(self.onStateChange) self.onLayoutFinish.append(self.onCreate) @@ -215,7 +215,7 @@ def updateState(self): showCleanup = True for x in self.list: - if (not x[0].disabled) and (x[1] == True): + if (not x[0].disabled) and (x[1] is True): break else: showCleanup = False @@ -268,7 +268,7 @@ def updateState(self): cb(name, time, duration, service, state) def fillTimerList(self): - #helper function to move finished timers to end of list + # helper function to move finished timers to end of list def _cmp(a, b): return (a > b) - (a < b) @@ -461,7 +461,7 @@ def __init__(self, session, timer): "red": self.editTimer1, "up": self.up, "down": self.down - }, -1) + }, -1) # noqa: E123 self.onShown.append(self.updateState) def getTimerList(self, timer): From e4806e6593025707141348fdb8e1f216a62a2dee Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:50:27 +0200 Subject: [PATCH 158/203] [TextBox] - PEP8 complaints --- lib/python/Screens/TextBox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/TextBox.py b/lib/python/Screens/TextBox.py index 83c1346bb5d..f9c0a3a354f 100644 --- a/lib/python/Screens/TextBox.py +++ b/lib/python/Screens/TextBox.py @@ -27,7 +27,7 @@ def __init__(self, session, text="", title=None, skin_name=None, label=None): "right": self[self.label].pageDown, "pageUp": self[self.label].pageUp, "pageDown": self[self.label].pageDown, - }, prio=1) + }, prio=1) # noqa: E126 if title: self.setTitle(title) From 14094e0e6bee8c7d852c5ae6c895bd5a3239507d Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:51:06 +0200 Subject: [PATCH 159/203] [TaskView] - PEP8 complaints --- lib/python/Screens/TaskView.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/TaskView.py b/lib/python/Screens/TaskView.py index 842e635ea06..e906ec0d788 100644 --- a/lib/python/Screens/TaskView.py +++ b/lib/python/Screens/TaskView.py @@ -111,7 +111,7 @@ def state_changed(self): self["summary_job_progress"].range = j.end self["job_progress"].value = j.progress self["summary_job_progress"].value = j.progress - #print "JobView::state_changed:", j.end, j.progress + # print "JobView::state_changed:", j.end, j.progress self["job_status"].text = j.getStatustext() if j.status == j.IN_PROGRESS: self["job_task"].text = j.tasks[j.current_task].name From 3555179af209bba0b730a8acb6775b08dd11892a Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:51:48 +0200 Subject: [PATCH 160/203] [SubtitleDisplay] - PEP8 complaints --- lib/python/Screens/SubtitleDisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/SubtitleDisplay.py b/lib/python/Screens/SubtitleDisplay.py index 6552d26af21..2998060c41e 100644 --- a/lib/python/Screens/SubtitleDisplay.py +++ b/lib/python/Screens/SubtitleDisplay.py @@ -3,7 +3,7 @@ from enigma import eTimer, getDesktop, eActionMap, gFont from Components.Label import Label from Screens.Screen import Screen -import skin +import skin # noqa: F401 class SubtitleDisplay(Screen): From d146c2044765776929bc76e9ea023219d0a5cab5 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:52:51 +0200 Subject: [PATCH 161/203] [SubservicesQuickzap] - PEP8 complaints --- lib/python/Screens/SubservicesQuickzap.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/python/Screens/SubservicesQuickzap.py b/lib/python/Screens/SubservicesQuickzap.py index 54f13772b8b..bac73692651 100644 --- a/lib/python/Screens/SubservicesQuickzap.py +++ b/lib/python/Screens/SubservicesQuickzap.py @@ -9,10 +9,7 @@ from Components.Timeshift import InfoBarTimeshift -class SubservicesQuickzap(InfoBarBase, InfoBarShowHide, InfoBarMenu, - InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, - InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, - InfoBarAudioSelection, Screen): +class SubservicesQuickzap(InfoBarBase, InfoBarShowHide, InfoBarMenu, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarAudioSelection, Screen): def __init__(self, session, subservices): Screen.__init__(self, session) @@ -41,7 +38,7 @@ def __init__(self, session, subservices): "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal - }, 0) + }, 0) # noqa: E123 self.onLayoutFinish.append(self.onLayoutFinished) self.onClose.append(self.__onClose) From dc24119fdcb29ac2629aa3c255687510a9a5c452 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:53:28 +0200 Subject: [PATCH 162/203] [StreamingClientsInfo] - PEP8 complaints --- lib/python/Screens/StreamingClientsInfo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/StreamingClientsInfo.py b/lib/python/Screens/StreamingClientsInfo.py index 6ccc37f8757..4c30813b481 100644 --- a/lib/python/Screens/StreamingClientsInfo.py +++ b/lib/python/Screens/StreamingClientsInfo.py @@ -6,7 +6,7 @@ from Components.ScrollLabel import ScrollLabel from Components.Sources.StaticText import StaticText from Screens.Screen import Screen -import skin +import skin # noqa: F401 class StreamingClientsInfo(Screen): @@ -27,7 +27,7 @@ def __init__(self, session): "blue": self.stopStreams, "up": self["ScrollLabel"].pageUp, "down": self["ScrollLabel"].pageDown - }) + }) # noqa: E123 self.onLayoutFinish.append(self.start) From 6d49677bd702a4e2da2d87a1a779cc114d2b2fd4 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 14:54:44 +0200 Subject: [PATCH 163/203] [StartWizard] - PEP8 complaints --- lib/python/Screens/StartWizard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/StartWizard.py b/lib/python/Screens/StartWizard.py index e83562b3b5c..c1b9714f09c 100644 --- a/lib/python/Screens/StartWizard.py +++ b/lib/python/Screens/StartWizard.py @@ -1,6 +1,6 @@ from Components.config import config, ConfigBoolean, configfile from Components.Pixmap import Pixmap -from Screens.LanguageSelection import LanguageWizard +from Screens.LanguageSelection import LanguageWizard # noqa: F401 from Screens.Rc import Rc from Screens.WizardLanguage import WizardLanguage from Screens.WizardUserInterfacePositioner import UserInterfacePositionerWizard @@ -37,7 +37,7 @@ def markDone(self): configfile.save() -#wizardManager.registerWizard(VideoWizard, config.misc.Vuwizardenabled.value, priority=2) +# wizardManager.registerWizard(VideoWizard, config.misc.Vuwizardenabled.value, priority=2) wizardManager.registerWizard(VuWizard, config.misc.Vuwizardenabled.value, priority=3) wizardManager.registerWizard(VideoWizard, config.misc.videowizardenabled.value, priority=10) wizardManager.registerWizard(UserInterfacePositionerWizard, config.misc.firstrun.value, priority=20) From a396fc832d5ebe8b7f0048ceb2248b2afcb7ca1a Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:00:58 +0200 Subject: [PATCH 164/203] [SoftwareUpdate] - PEP8 complaints --- lib/python/Screens/SoftwareUpdate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/SoftwareUpdate.py b/lib/python/Screens/SoftwareUpdate.py index bec66f1b75a..8aaa463fffb 100644 --- a/lib/python/Screens/SoftwareUpdate.py +++ b/lib/python/Screens/SoftwareUpdate.py @@ -7,7 +7,7 @@ from Components.Ipkg import IpkgComponent from Components.Pixmap import Pixmap from Components.Label import Label -from Components.ScrollLabel import ScrollLabel +from Components.ScrollLabel import ScrollLabel # noqa: F401 from Components.Sources.StaticText import StaticText from Components.Slider import Slider import Components.Task @@ -329,7 +329,7 @@ def ipkgCallback(self, event, param): if 'enigma2-plugin-settings-' in param[0] and self.channellist_only > 0: self.channellist_name = param[0] self.channellist_only = 2 - #print( event, "-", param) + # print( event, "-", param) pass def setEndMessage(self, txt): From dcbf90f6c3732ff1a0cf55ef976b14a4bb2cf2b9 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:02:54 +0200 Subject: [PATCH 165/203] [SoftcamScript] - PEP8 complaints --- lib/python/Screens/SoftcamScript.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/python/Screens/SoftcamScript.py b/lib/python/Screens/SoftcamScript.py index fc47cecb9ba..72cb1393fe4 100644 --- a/lib/python/Screens/SoftcamScript.py +++ b/lib/python/Screens/SoftcamScript.py @@ -1,8 +1,8 @@ -from enigma import eTimer, getDesktop +from enigma import eTimer from Components.ActionMap import HelpableActionMap -from Components.config import config, ConfigSelection +from Components.config import config from Components.ScrollLabel import ScrollLabel from Components.Sources.StaticText import StaticText from Screens.MessageBox import MessageBox @@ -97,7 +97,6 @@ def restart(self, camtype=None): def doStop(self): self.activityTimer.stop() -# if "s" in self.camtype: self.softcam.command("stop") self.oldref = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.session.nav.stopService() @@ -113,7 +112,6 @@ def doStart(self): msg = _("No configs for specifies softcam %s." % config.misc.softcams.value) self.mbox = self.session.open(MessageBox, msg, MessageBox.TYPE_INFO) self.camtype = "None" -# elif "s" in self.camtype: self.softcam.select(config.misc.softcams.value) if config.misc.softcams.value != "None": self.softcam.command("start") From 8e175ed9496bf548d17d4a7485f9a436a5f88dca Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:04:01 +0200 Subject: [PATCH 166/203] [Setup] - PEP8 complaints --- lib/python/Screens/Setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/Setup.py b/lib/python/Screens/Setup.py index 0fbcff8678f..4f85501feea 100644 --- a/lib/python/Screens/Setup.py +++ b/lib/python/Screens/Setup.py @@ -2,7 +2,7 @@ from gettext import dgettext from os.path import getmtime, join as pathjoin -from skin import setups, findSkinScreen # used in to check if a screen name is available in the skin +from skin import setups, findSkinScreen # noqa: F401 used in to check if a screen name is available in the skin from Components.config import ConfigBoolean, ConfigNothing, ConfigSelection, config from Components.ConfigList import ConfigListScreen @@ -235,7 +235,7 @@ def selectionChanged(self): def setupDom(setup=None, plugin=None): # Constants for checkItems() ROOT_ALLOWED = ("setup", ) # Tags allowed in top level of setupxml entry. - ELEMENT_ALLOWED = ("item", "if") # Tags allowed in top level of setup entry. + ELEMENT_ALLOWED = ("item", "if") # noqa: F841 Tags allowed in top level of setup entry. IF_ALLOWED = ("item", "if", "elif", "else") # Tags allowed inside . AFTER_ELSE_ALLOWED = ("item", "if") # Tags allowed after or . CHILDREN_ALLOWED = ("setup", "if", ) # Tags that may have children. From 4ae5a6c97d68ea6992b2250f952616094cb19e3c Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:05:33 +0200 Subject: [PATCH 167/203] [ScreenSaver] - PEP8 complaints --- lib/python/Screens/ScreenSaver.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/python/Screens/ScreenSaver.py b/lib/python/Screens/ScreenSaver.py index 93352f0bc7f..eac9450de1d 100644 --- a/lib/python/Screens/ScreenSaver.py +++ b/lib/python/Screens/ScreenSaver.py @@ -16,9 +16,7 @@ def __init__(self, session): self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) - self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - iPlayableService.evStart: self.serviceStarted - }) + self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evStart: self.serviceStarted}) self["picture"] = Pixmap() From 154473cd99d4645ddf9bc4f04f9760339c602a62 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:13:43 +0200 Subject: [PATCH 168/203] [ScanSetupr] - remove 1 unused tlist and unused Satlist plus PEP8 complaints --- lib/python/Screens/ScanSetup.py | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py index cc8f9a7215a..35c74e3db36 100644 --- a/lib/python/Screens/ScanSetup.py +++ b/lib/python/Screens/ScanSetup.py @@ -21,7 +21,7 @@ def buildTerTransponder(frequency, inversion=2, bandwidth=7000000, fechigh=6, feclow=6, modulation=2, transmission=2, guard=4, hierarchy=4, system=0, plp_id=0): - #print("freq", frequency, "inv", inversion, "bw", bandwidth, "fech", fechigh, "fecl", feclow, "mod", modulation, "tm", transmission, "guard", guard, "hierarchy", hierarchy, "system", system, "plp_id", plp_id) + # print("freq", frequency, "inv", inversion, "bw", bandwidth, "fech", fechigh, "fecl", feclow, "mod", modulation, "tm", transmission, "guard", guard, "hierarchy", hierarchy, "system", system, "plp_id", plp_id) parm = eDVBFrontendParametersTerrestrial() parm.frequency = frequency parm.inversion = inversion @@ -115,22 +115,22 @@ def getInitialATSCTransponderList(tlist, nim): } cable_autoscan_nimtype = { -'SSH108': 'ssh108', -'TT3L10': 'tt3l10', -'TURBO': 'vuplus_turbo_c', -'TURBO2': 'vuplus_turbo2_c', -'TT2L08': 'tt2l08', -'BCM3148': 'bcm3148', # BCM3158/BCM3148 use the same bcm3148 utility -'BCM3158': 'bcm3148' + 'SSH108': 'ssh108', + 'TT3L10': 'tt3l10', + 'TURBO': 'vuplus_turbo_c', + 'TURBO2': 'vuplus_turbo2_c', + 'TT2L08': 'tt2l08', + 'BCM3148': 'bcm3148', # BCM3158/BCM3148 use the same bcm3148 utility + 'BCM3158': 'bcm3148' } terrestrial_autoscan_nimtype = { -'SSH108': 'ssh108_t2_scan', -'TT3L10': 'tt3l10_t2_scan', -'TURBO': 'vuplus_turbo_t', -'TURBO2': 'vuplus_turbo2_t', -'TT2L08': 'tt2l08_t2_scan', -'BCM3466': 'bcm3466' + 'SSH108': 'ssh108_t2_scan', + 'TT3L10': 'tt3l10_t2_scan', + 'TURBO': 'vuplus_turbo_t', + 'TURBO2': 'vuplus_turbo2_t', + 'TT2L08': 'tt2l08_t2_scan', + 'BCM3466': 'bcm3466' } dual_tuner_list = ('TT3L10', 'BCM3466') @@ -202,12 +202,12 @@ def cableTransponderSearchClosed(self, retval): def getCableTransponderData(self, str): str = six.ensure_str(str) print("[getCableTransponderData] ", str) - #prepend any remaining data from the previous call + # prepend any remaining data from the previous call str = self.remainingdata + str lines = str.split('\n') - #'str' should end with '\n', so when splitting, the last line should be empty. If this is not the case, we received an incomplete line + # 'str' should end with '\n', so when splitting, the last line should be empty. If this is not the case, we received an incomplete line if len(lines[-1]): - #remember this data for next time + # remember this data for next time self.remainingdata = lines[-1] lines = lines[0:-1] else: @@ -849,7 +849,7 @@ def createSetup(self): self.list.append(getConfigListEntry(_("Inversion"), self.scan_ats.inversion)) self.list.append(getConfigListEntry(_("Modulation"), self.scan_ats.modulation)) elif self.scan_type_atsc.value == "predefined_transponder": - #FIXME add region + # FIXME add region self.predefinedATSCTranspondersList() self.list.append(getConfigListEntry(_('Transponder'), self.ATSCTransponders, _("Select which transponder to scan."))) elif self.scan_type_atsc.value == "complete": @@ -1145,8 +1145,8 @@ def createConfig(self, frontendData): (7000000, "7MHz"), (8000000, "8MHz"), (10000000, "10MHz") - ]) - #, (eDVBFrontendParametersTerrestrial.Bandwidth_Auto, _("Auto")))) + ]) # noqa: E123 + # , (eDVBFrontendParametersTerrestrial.Bandwidth_Auto, _("Auto")))) self.scan_ter.fechigh = ConfigSelection(default=defaultTer["fechigh"], choices=[ (eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"), (eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"), @@ -1229,7 +1229,7 @@ def createConfig(self, frontendData): self.scan_scansat = {} for sat in nimmanager.satList: - #print(sat[1]) + # print(sat[1]) self.scan_scansat[sat[0]] = ConfigYesNo(default=False) self.scan_satselection = [] @@ -1393,7 +1393,7 @@ def keyGoCheckTimeshiftCallback(self, answer): sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index] getInitialTransponderList(tlist, sat[0], index_to_scan) elif "multisat" in self.scan_type.value: - SatList = nimmanager.getSatListForNim(index_to_scan) + # SatList = nimmanager.getSatListForNim(index_to_scan) # not used variable? for x in self.multiscanlist: if x[1].value: print("[ScanSetup] " + str(x[0])) @@ -1708,7 +1708,7 @@ def __init__(self, session): self.session.postScanService = session.nav.getCurrentlyPlayingServiceOrGroup() self.list = [] - tlist = [] + # tlist = [] known_networks = [] nims_to_scan = [] From 02625fdb9ba39cbcce77c73e7e2ba4b888a9edbb Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:18:33 +0200 Subject: [PATCH 169/203] [Satconfig] - remove unused self.IDX variable plus PEP8 complaints --- lib/python/Screens/Satconfig.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index 8b94f69d8c4..5e47109a1f1 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -82,8 +82,8 @@ def createPositionerSetup(self, list): def adaptConfigModeChoices(self): if self.nim.isCompatible("DVB-S") and not self.nim.isFBCLink(): - #redefine configMode choices with only the possible/required options. - #We have to pre-define them here as here all tuner configs are known + # redefine configMode choices with only the possible/required options. + # We have to pre-define them here as here all tuner configs are known config_mode_choices = {"simple": _("Simple"), "advanced": _("Advanced")} if not self.nim.multi_type: config_mode_choices["nothing"] = _("Disabled") @@ -99,12 +99,12 @@ def createSetup(self): self.adaptConfigModeChoices() self.list = [] - self.multiType = self.configMode = self.diseqcModeEntry = self.advancedSatsEntry = self.advancedLnbsEntry = self.advancedDiseqcMode = self.advancedUsalsEntry = self.advancedLof =\ - self.advancedPowerMeasurement = self.turningSpeed = self.turnFastEpochBegin = self.turnFastEpochEnd = self.toneburst = self.committedDiseqcCommand = self.uncommittedDiseqcCommand =\ - self.commandOrder = self.cableScanType = self.cableConfigScanDetails = self.advancedUnicable = self.advancedFormat = self.advancedPosition = self.advancedType = self.advancedManufacturer =\ - self.advancedSCR = self.advancedConnected = self.showAdditionalMotorOptions = self.selectSatsEntry = self.advancedSelectSatsEntry = self.singleSatEntry = self.toneamplitude = self.scpc =\ - self.t2mirawmode = self.forcelnbpower = self.forcetoneburst = self.terrestrialRegionsEntry = self.cableRegionsEntry = self.configModeDVBS = self.configModeDVBC = self.configModeDVBT =\ - self.configModeATSC = self.externallyPowered = None + self.multiType = self.configMode = self.diseqcModeEntry = self.advancedSatsEntry = self.advancedLnbsEntry = self.advancedDiseqcMode = self.advancedUsalsEntry = self.advancedLof = \ + self.advancedPowerMeasurement = self.turningSpeed = self.turnFastEpochBegin = self.turnFastEpochEnd = self.toneburst = self.committedDiseqcCommand = self.uncommittedDiseqcCommand = \ + self.commandOrder = self.cableScanType = self.cableConfigScanDetails = self.advancedUnicable = self.advancedFormat = self.advancedPosition = self.advancedType = self.advancedManufacturer = \ + self.advancedSCR = self.advancedConnected = self.showAdditionalMotorOptions = self.selectSatsEntry = self.advancedSelectSatsEntry = self.singleSatEntry = self.toneamplitude = self.scpc = \ + self.t2mirawmode = self.forcelnbpower = self.forcetoneburst = self.terrestrialRegionsEntry = self.cableRegionsEntry = self.configModeDVBS = self.configModeDVBC = self.configModeDVBT = \ + self.configModeATSC = self.externallyPowered = None self.have_advanced = False self.indent = " %s" if self.nim.isCombined() else "%s" @@ -132,7 +132,7 @@ def createSetup(self): self.configMode = getConfigListEntry(self.indent % _("Configuration mode"), self.nimConfig.configMode, _("Select 'FBC SCR' if this tuner will connect to a SCR (Unicable/JESS) device. For all other setups select 'FBC automatic'.") if self.nim.isFBCLink() else _("Configure this tuner using simple or advanced options, or loop it through to another tuner, or copy a configuration from another tuner, or disable it.")) self.list.append(self.configMode) warning_text = _(" Warning: the selected tuner should not use SCR Unicable type for LNBs because each tuner need a own SCR number.") - if self.nimConfig.configMode.value == "simple": #simple setup + if self.nimConfig.configMode.value == "simple": # simple setup self.diseqcModeEntry = getConfigListEntry(self.indent % pgettext("Satellite configuration mode", "Mode"), self.nimConfig.diseqcMode, _("Select how the satellite dish is set up. i.e. fixed dish, single LNB, DiSEqC switch, positioner, etc.")) self.list.append(self.diseqcModeEntry) if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"): @@ -334,7 +334,7 @@ def newConfig(self): self.advancedUnicable, self.advancedConnected, self.toneburst, self.committedDiseqcCommand, self.uncommittedDiseqcCommand, self.singleSatEntry, self.commandOrder, self.showAdditionalMotorOptions, self.cableScanType, self.multiType, self.cableConfigScanDetails, self.terrestrialCountriesEntry, self.cableCountriesEntry, self.toneamplitude, self.scpc, self.t2mirawmode, self.forcelnbpower, self.forcetoneburst, self.externallyPowered): - self.createSetup() + self.createSetup() def run(self): if self.nimConfig.configMode.value == "simple" and self.nimConfig.diseqcMode.value in ("single", "diseqc_a_b", "diseqc_a_b_c_d") and (not self.nim.isCombined() or self.nimConfig.configModeDVBS.value): @@ -545,8 +545,6 @@ def checkLoopthrough(self): for x in dvbs_slots: try: nim_slot = nimmanager.nim_slots[x] - if nim_slot == self.nimConfig: - self_idx = x if nim_slot.config.configMode.value == "loopthrough": loopthrough_count += 1 except: From bffd20a9338b5ed2b696ad74d81006a0e6029baa Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:19:41 +0200 Subject: [PATCH 170/203] [RdsDisplayy] - PEP8 complaints --- lib/python/Screens/RdsDisplay.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/python/Screens/RdsDisplay.py b/lib/python/Screens/RdsDisplay.py index fdfa04df616..63da0f39c68 100644 --- a/lib/python/Screens/RdsDisplay.py +++ b/lib/python/Screens/RdsDisplay.py @@ -30,11 +30,11 @@ def __init__(self, session): Screen.__init__(self, session) self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - iPlayableService.evEnd: self.__serviceStopped, - iPlayableService.evUpdatedRadioText: self.RadioTextChanged, - iPlayableService.evUpdatedRtpText: self.RtpTextChanged, - iPlayableService.evUpdatedRassInteractivePicMask: self.RassInteractivePicMaskChanged, - }) + iPlayableService.evEnd: self.__serviceStopped, + iPlayableService.evUpdatedRadioText: self.RadioTextChanged, + iPlayableService.evUpdatedRtpText: self.RtpTextChanged, + iPlayableService.evUpdatedRassInteractivePicMask: self.RassInteractivePicMaskChanged, + }) self["RadioText"] = Label() self["RtpText"] = Label() @@ -118,11 +118,11 @@ def __init__(self, session): "prevPage": self.prevPage, "nextSubPage": self.nextSubPage, "prevSubPage": self.prevSubPage - }) + }) # noqa: E123 self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - iPlayableService.evUpdatedRassInteractivePicMask: self.recvRassInteractivePicMaskChanged - }) + iPlayableService.evUpdatedRassInteractivePicMask: self.recvRassInteractivePicMaskChanged + }) self["subpages_1"] = Pixmap() self["subpages_2"] = Pixmap() From 57fb2ec89d715d7fe39bab333746f4f82b22b76d Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:21:01 +0200 Subject: [PATCH 171/203] [Rc] - PEP8 complaints --- lib/python/Screens/Rc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/Rc.py b/lib/python/Screens/Rc.py index 37b51120ddf..b2d44564004 100644 --- a/lib/python/Screens/Rc.py +++ b/lib/python/Screens/Rc.py @@ -5,7 +5,7 @@ from Tools.Directories import resolveFilename, SCOPE_SKIN, fileReadXML from Tools.KeyBindings import keyDescriptions -config.misc.rcused = ConfigInteger(default=1) +config.misc.rcused = ConfigInteger(default=1) # all E2 receivers use default 1 - retained in case this changes(used by KeyBindings, InputDeviceSetup, MessageBox) class Rc: @@ -42,7 +42,7 @@ def __init__(self, owner, activeYPos, pixmaps): self.pixmaps = [] for actYpos, pixmap in zip(activeYPos, pixmaps): pm = self.KeyIndicatorPixmap(actYpos, pixmap) -# print("[KeyIndicator]", actYpos, pixmap) + # print("[KeyIndicator]", actYpos, pixmap) owner[pixmap] = pm self.pixmaps.append(pm) self.pixmaps.sort(key=lambda x: x.activeYPos) From b2eb7f55e9bc22e15028b6791f2e7b0fb34b98c8 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 15:23:39 +0200 Subject: [PATCH 172/203] [PowerTimerEntry] -remove unusede localtime, strftime plus PEP8 complaints --- lib/python/Screens/PowerTimerEntry.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/python/Screens/PowerTimerEntry.py b/lib/python/Screens/PowerTimerEntry.py index 73703959cf0..52adcc78aa5 100644 --- a/lib/python/Screens/PowerTimerEntry.py +++ b/lib/python/Screens/PowerTimerEntry.py @@ -3,7 +3,7 @@ from Components.ActionMap import HelpableActionMap, NumberActionMap from Components.SystemInfo import SystemInfo from PowerTimer import AFTEREVENT, TIMERTYPE -from time import localtime, time, strftime +from time import time class TimerEntry(TimerEntryBase): @@ -17,7 +17,7 @@ def createConfig(self): AFTEREVENT.WAKEUPTOSTANDBY: "wakeuptostandby", AFTEREVENT.STANDBY: "standby", AFTEREVENT.DEEPSTANDBY: "deepstandby" - }[self.timer.afterEvent] + }[self.timer.afterEvent] # noqa: E123 timertype = { TIMERTYPE.WAKEUP: "wakeup", @@ -28,7 +28,7 @@ def createConfig(self): TIMERTYPE.DEEPSTANDBY: "deepstandby", TIMERTYPE.REBOOT: "reboot", TIMERTYPE.RESTART: "restart" - }[self.timer.timerType] + }[self.timer.timerType] # noqa: E123 autosleepinstandbyonly = self.timer.autosleepinstandbyonly autosleepdelay = self.timer.autosleepdelay @@ -64,13 +64,13 @@ def keySave(self): "deepstandby": TIMERTYPE.DEEPSTANDBY, "reboot": TIMERTYPE.REBOOT, "restart": TIMERTYPE.RESTART - }[self.timerentry_timertype.value] + }[self.timerentry_timertype.value] # noqa: E123 self.timer.afterEvent = { "nothing": AFTEREVENT.NONE, "wakeuptostandby": AFTEREVENT.WAKEUPTOSTANDBY, "standby": AFTEREVENT.STANDBY, "deepstandby": AFTEREVENT.DEEPSTANDBY - }[self.timerentry_afterevent.value] + }[self.timerentry_afterevent.value] # noqa: E123 if self.timerentry_type.value == "once": self.timer.begin, self.timer.end = self.getBeginEnd() From 08aa2762011acfb5d4271fb9362aa49d9fc73356 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 16:29:11 +0200 Subject: [PATCH 173/203] [PowerTimerEdit] -PEP8 complaints --- lib/python/Screens/PowerTimerEdit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/python/Screens/PowerTimerEdit.py b/lib/python/Screens/PowerTimerEdit.py index 311d45f3aa6..9adf182f659 100644 --- a/lib/python/Screens/PowerTimerEdit.py +++ b/lib/python/Screens/PowerTimerEdit.py @@ -56,7 +56,7 @@ def __init__(self, session): "right": self.right, "up": self.up, "down": self.down - }, -1) + }, -1) # noqa: E123 self.session.nav.PowerTimer.on_state_change.append(self.onStateChange) self.onShown.append(self.updateState) self["timerlist"].selectionChanged() @@ -190,7 +190,7 @@ def updateState(self): cb(time, duration, state) def fillTimerList(self): - #helper function to move finished timers to end of list + # helper function to move finished timers to end of list def xcmp(a, b): return (a > b) - (a < b) @@ -278,7 +278,7 @@ def finishedEdit(self, answer): def finishedAdd(self, answer): if answer[0]: entry = answer[1] - simulTimerList = self.session.nav.PowerTimer.record(entry) + simulTimerList = self.session.nav.PowerTimer.record(entry) # noqa: F841 self.fillTimerList() self.updateState() else: From f3bc36f89b51d6453caf6f7cda39ee1f3b378a80 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 16:30:20 +0200 Subject: [PATCH 174/203] [PluginBrowser] -PEP8 complaints --- lib/python/Screens/PluginBrowser.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py index 86b203202d3..b6d3cb896ea 100644 --- a/lib/python/Screens/PluginBrowser.py +++ b/lib/python/Screens/PluginBrowser.py @@ -343,7 +343,7 @@ def selectionChanged(self): cb(name, desc) def createPluginFilter(self): - #Create Plugin Filter + # Create Plugin Filter self.PLUGIN_PREFIX2 = [] if config.misc.pluginbrowser.bootlogos.value: self.PLUGIN_PREFIX2.append(self.PLUGIN_PREFIX + 'bootlogos') @@ -571,13 +571,13 @@ def dataAvail(self, str): if self.type == self.DOWNLOAD and any([x for x in ('wget returned 1', 'wget returned 255', '404 Not Found') if x in str]): self.run = 3 return - #prepend any remaining data from the previous call + # prepend any remaining data from the previous call str = self.remainingdata + str - #split in lines + # split in lines lines = str.split('\n') - #'str' should end with '\n', so when splitting, the last line should be empty. If this is not the case, we received an incomplete line + # 'str' should end with '\n', so when splitting, the last line should be empty. If this is not the case, we received an incomplete line if len(lines[-1]): - #remember this data for next time + # remember this data for next time self.remainingdata = lines[-1] lines = lines[0:-1] else: From 4970b78c7de437cb7b7de7b6103078fc6f7fac1f Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 16:33:00 +0200 Subject: [PATCH 175/203] [PictureInPicture] -unused variable h and PEP8 complaints --- lib/python/Screens/PictureInPicture.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/PictureInPicture.py b/lib/python/Screens/PictureInPicture.py index bd2ae5abc56..f80fcaf3e40 100644 --- a/lib/python/Screens/PictureInPicture.py +++ b/lib/python/Screens/PictureInPicture.py @@ -133,7 +133,7 @@ def move(self, x, y, doSave=True): config.av.pip.value[1] = y config.av.pip.save() w = config.av.pip.value[2] - h = config.av.pip.value[3] + # h = config.av.pip.value[3] if config.av.pip_mode.value == "cascade": x = MAX_X - w y = 0 @@ -228,7 +228,7 @@ def playService(self, service): if not config.usage.hide_zap_errors.value: Tools.Notifications.AddPopup(text="PiP...\n" + _("Connected transcoding, limit - no PiP!"), type=MessageBox.TYPE_ERROR, timeout=5, id="ZapPipError") return False - if ref.toString().startswith("4097"): # Change to service type 1 and try to play a stream as type 1 + if ref.toString().startswith("4097"): # Change to service type 1 and try to play a stream as type 1 ref = eServiceReference("1" + ref.toString()[4:]) if not self.isPlayableForPipService(ref): if not config.usage.hide_zap_errors.value: From 85f93c5b3c8958c2cab28a186613b7e9ee21ab5f Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 16:44:07 +0200 Subject: [PATCH 176/203] [OscamInfo] -pass 1 PEP8 cleanup --- lib/python/Screens/OScamInfo.py | 111 ++++++++++++++++---------------- 1 file changed, 55 insertions(+), 56 deletions(-) diff --git a/lib/python/Screens/OScamInfo.py b/lib/python/Screens/OScamInfo.py index d81f97f17cc..4f8b0fc25b8 100644 --- a/lib/python/Screens/OScamInfo.py +++ b/lib/python/Screens/OScamInfo.py @@ -57,7 +57,6 @@ def check_NAMEBIN2(): elif screenwidth and screenwidth > 1024: sizeH = screenwidth - 100 HDSKIN = True -###global class OscamInfo: @@ -125,12 +124,12 @@ def getUserData(self): ret = _("%s webif disabled" % NAMEBIN) if webif and port is not None: - # oscam/ncam reports it got webif support and webif is running (Port != 0) + # oscam/ncam reports it got webif support and webif is running (Port != 0) if conf is not None and ospath.exists(conf): # If we have a config file, we need to investigate it further with open(conf, 'r') as data: for i in data: -# print("[OscamInfo][getUserData] i", i) + # print("[OscamInfo][getUserData] i", i) if "httpuser" in i.lower(): user = i.split("=")[1].strip() elif "httppwd" in i.lower(): @@ -154,10 +153,10 @@ def getUserData(self): def openWebIF(self, part=None, reader=None): NAMEBIN = check_NAMEBIN() self.proto = "http" -# print("[OscamInfo][openWebIF] NAMEBIN part", NAMEBIN, " ", part) + # print("[OscamInfo][openWebIF] NAMEBIN part", NAMEBIN, " ", part) if config.oscaminfo.userdatafromconf.value: udata = self.getUserData() -# print("[OscamInfo][openWebIF] udata, config.oscaminfo.userdatafromconf.value: ", udata, " ", config.oscaminfo.userdatafromconf.value) + # print("[OscamInfo][openWebIF] udata, config.oscaminfo.userdatafromconf.value: ", udata, " ", config.oscaminfo.userdatafromconf.value) if isinstance(udata, str): return False, udata else: @@ -170,33 +169,33 @@ def openWebIF(self, part=None, reader=None): self.ip = "::1" else: self.ip = "127.0.0.1" -# self.ip = local address 127.0.0.1 gets 403 in Oscam webif so try to pick up box IP address. + # self.ip = local address 127.0.0.1 gets 403 in Oscam webif so try to pick up box IP address. eth0 = about.getIfConfig("eth0") wlan0 = about.getIfConfig("wlan0") if "addr" in eth0: self.ip = eth0["addr"] if "addr" in wlan0: self.ip = wlan0["addr"] -# print("[OscamInfo][openWebIF]1 self.ip self.port self.username self.password self.ipaccess", self.ip, " ", self.port, " ", self.username, " ", self.password, " ", self.ipaccess) + # print("[OscamInfo][openWebIF]1 self.ip self.port self.username self.password self.ipaccess", self.ip, " ", self.port, " ", self.username, " ", self.password, " ", self.ipaccess) else: self.ip = ".".join("%d" % d for d in config.oscaminfo.ip.value) self.port = str(config.oscaminfo.port.value) self.username = str(config.oscaminfo.username.value) self.password = str(config.oscaminfo.password.value) -# print("[OscamInfo][openWebIF]2 self.ip self.port self.username self.password", self.ip, " ", self.port, " ", self.username, " ", self.password) + # print("[OscamInfo][openWebIF]2 self.ip self.port self.username self.password", self.ip, " ", self.port, " ", self.username, " ", self.password) if self.port.startswith('+'): self.proto = "https" self.port.replace("+", "") -# print("[OscamInfo][openWebIF] NAMEBIN=%s, CAM=%s" % (NAMEBIN, NAMEBIN)) + # print("[OscamInfo][openWebIF] NAMEBIN=%s, CAM=%s" % (NAMEBIN, NAMEBIN)) if part is None: self.url = "%s://%s:%s/%sapi.html?part=status" % (self.proto, self.ip, self.port, NAMEBIN) else: self.url = "%s://%s:%s/%sapi.html?part=%s" % (self.proto, self.ip, self.port, NAMEBIN, part) if part is not None and reader is not None: -# print("[OscamInfo][openWebIF] reader:", reader) + # print("[OscamInfo][openWebIF] reader:", reader) self.url = "%s://%s:%s/%sapi.html?part=%s&label=%s" % (self.proto, self.ip, self.port, NAMEBIN, part, urllib.parse.quote_plus(reader)) -# print("[OscamInfo][openWebIF] NAMEBIN=%s, NAMEBIN=%s url=%s" % (NAMEBIN, NAMEBIN, self.url)) -# print("[OscamInfo][openWebIF] self.url=%s" % self.url) + # print("[OscamInfo][openWebIF] NAMEBIN=%s, NAMEBIN=%s url=%s" % (NAMEBIN, NAMEBIN, self.url)) + # print("[OscamInfo][openWebIF] self.url=%s" % self.url) opener = build_opener(HTTPHandler) if not self.username == "": pwman = HTTPPasswordMgrWithDefaultRealm() @@ -208,7 +207,7 @@ def openWebIF(self, part=None, reader=None): err = False try: data = urlopen(request).read() -# print("[OscamInfo][openWebIF] data=", data) + # print("[OscamInfo][openWebIF] data=", data) except URLError as e: print("[OscamInfo][openWebIF] error: %s" % e) if hasattr(e, "reason"): @@ -232,7 +231,7 @@ def readXML(self, typ): retval = [] tmp = {} if result[0]: -# print("[OscamInfo][readXML] show typ, result 0,1", typ, " ", result[0], " ", result[1]) + # print("[OscamInfo][readXML] show typ, result 0,1", typ, " ", result[0], " ", result[1]) if not self.showLog: dataXML = ElementTree.XML(result[1]) if typ == "version": @@ -451,7 +450,7 @@ def __init__(self, session): "0": self.keyNumberGlobal, "up": self.up, "down": self.down - }, -1) + }, -1) # noqa: E123 self.onLayoutFinish.append(self.showMenu) def ok(self): @@ -498,7 +497,7 @@ def down(self): def goEntry(self, entry): NAMEBIN = check_NAMEBIN() if NAMEBIN: -# print("[OscamInfo][goEntry] NAMEBIN=%s" % (NAMEBIN)) + # print("[OscamInfo][goEntry] NAMEBIN=%s" % (NAMEBIN)) if entry in (1, 2, 3) and config.oscaminfo.userdatafromconf.value and self.osc.confPath()[0] is None: config.oscaminfo.userdatafromconf.setValue(False) config.oscaminfo.userdatafromconf.save() @@ -606,10 +605,10 @@ def __init__(self, session): timeout = config.oscaminfo.intervall.value * 1000 self.loop.start(timeout, False) self["actions"] = ActionMap(["SetupActions"], - { - "ok": self.exit, - "cancel": self.exit - }, -1) + { + "ok": self.exit, + "cancel": self.exit + }, -1) # noqa: E123 self["key_red"] = StaticText(_("Close")) self.onLayoutFinish.append(self.showData) @@ -623,7 +622,7 @@ def buildListEntry(self, listentry): "", (eListboxPythonMultiContent.TYPE_TEXT, 10 * f, 2 * f, 300 * f, 30 * f, 0, RT_HALIGN_LEFT, listentry[0]), (eListboxPythonMultiContent.TYPE_TEXT, 300 * f, 2 * f, 300 * f, 30 * f, 0, RT_HALIGN_LEFT, listentry[1]) - ] + ] # noqa: E123 def showData(self): dataECM = self.getECMInfo(self.ecminfo) @@ -686,20 +685,20 @@ def __init__(self, session, what): timeout = config.oscaminfo.intervall.value * 1000 self.loop.start(timeout, False) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions"], - { - "ok": self.key_ok, - "cancel": self.exit, - "red": self.exit, - "green": self.key_green, - "yellow": self.key_yellow, - "blue": self.key_blue, - "up": self.key_up, - "down": self.key_down, - "right": self.key_right, - "left": self.key_left, - "moveUp": self.key_moveUp, - "moveDown": self.key_moveDown - }, -1) + { + "ok": self.key_ok, + "cancel": self.exit, + "red": self.exit, + "green": self.key_green, + "yellow": self.key_yellow, + "blue": self.key_blue, + "up": self.key_up, + "down": self.key_down, + "right": self.key_right, + "left": self.key_left, + "moveUp": self.key_moveUp, + "moveDown": self.key_moveDown + }, -1) # noqa: E123 self.onLayoutFinish.append(self.showData) def key_ok(self): @@ -825,9 +824,9 @@ def showData(self): data = self.readXML(typ=self.what) self.out = [] self.itemheight = 25 -# print("[OscamInfo][showData] data[0], data[1]", data[0], " ", data[1]) + # print("[OscamInfo][showData] data[0], data[1]", data[0], " ", data[1]) if data[0]: -# print("[OscamInfo][showData] data[0], data[1] not isinstance(data[1], str)") + # print("[OscamInfo][showData] data[0], data[1] not isinstance(data[1], str)") if self.what != "l": heading = (self.HEAD[self.NAME], self.HEAD[self.PROT], self.HEAD[self.CAID_SRVID], self.HEAD[self.SRVNAME], self.HEAD[self.ECMTIME], self.HEAD[self.IP_PORT], "") @@ -941,10 +940,10 @@ def __init__(self, session, reader): self.cccamreader = reader self["output"] = List([]) self["actions"] = ActionMap(["SetupActions"], - { - "ok": self.showData, - "cancel": self.exit - }, -1) + { + "ok": self.showData, + "cancel": self.exit + }, -1) # noqa: E123 self["key_red"] = StaticText(_("Close")) self.onLayoutFinish.append(self.showData) @@ -973,10 +972,10 @@ def buildList(self, data): for j in prov: providertxt += "%s - %s%s" % (j[0], j[1], linefeed) res.append((ca_id, - csystem, - str(hops[1]), str(hops[2]), str(hops[3]), str(hops[4]), str(hops[5]), str(csum), str(creshare), - providertxt[:-1] - )) + csystem, + str(hops[1]), str(hops[2]), str(hops[3]), str(hops[4]), str(hops[5]), str(csum), str(creshare), + providertxt[:-1] + )) # noqa: E123 outlist.append(res) return res @@ -1083,10 +1082,10 @@ def __init__(self, session, reader): self.mlist = oscMenuList([]) self["output"] = List([]) self["actions"] = ActionMap(["SetupActions"], - { - "ok": self.showData, - "cancel": self.exit - }, -1) + { + "ok": self.showData, + "cancel": self.exit + }, -1) # noqa: E123 self["key_red"] = StaticText(_("Close")) self.onLayoutFinish.append(self.showData) @@ -1115,10 +1114,10 @@ def buildList(self, data): for j in prov: providertxt += "%s - %s%s" % (j[0], j[1], linefeed) res.append((ca_id, - csystem, - str(hops[1]), str(hops[2]), str(hops[3]), str(hops[4]), str(hops[5]), str(csum), str(creshare), - providertxt[:-1] - )) + csystem, + str(hops[1]), str(hops[2]), str(hops[3]), str(hops[4]), str(hops[5]), str(csum), str(creshare), + providertxt[:-1] + )) # noqa: E123 outlist.append(res) return res @@ -1131,7 +1130,7 @@ def showData(self): title2 = "" for i in readers: dataWebif = self.openWebIF(part="readerstats", reader=i[1]) - emm_wri = emm_ski = emm_blk = emm_err = "" + # emm_wri = emm_ski = emm_blk = emm_err = "" if dataWebif[0]: dataReader = ElementTree.XML(dataWebif[1]) rdr = dataReader.find("reader") @@ -1172,8 +1171,8 @@ def showData(self): last_req = "" else: avg_time = last_time = last_req = "" -# if lastreq != "": -# last_req = lastreq.split("T")[1][:-5] + # if lastreq != "": + # last_req = lastreq.split("T")[1][:-5] if self.allreaders: result.append((i[1], caid, channel, avg_time, last_time, rcs, last_req, int(num))) title2 = _("(All readers)") From 38e672c9cd403553092c6b008d9f689faba8b053 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 16:47:13 +0200 Subject: [PATCH 177/203] [MultiBootSelector] -PEP8 cleanup --- lib/python/Screens/MultiBootSelector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/MultiBootSelector.py b/lib/python/Screens/MultiBootSelector.py index deb95d41ada..ab8d8b18669 100644 --- a/lib/python/Screens/MultiBootSelector.py +++ b/lib/python/Screens/MultiBootSelector.py @@ -127,8 +127,8 @@ def deleteImageCallback(self, answer): slot = currentSelected[0][1][0] # print("[MultiBootSelector] delete slot = %s" % slot) if SystemInfo["HasKexecMultiboot"] and int(slot) < 4: - # print("[MultiBootSelector] rm -rf delete slot = %s" % slot) - Console().ePopen("rm -rf /boot/linuxrootfs%s" % slot) + # print("[MultiBootSelector] rm -rf delete slot = %s" % slot) + Console().ePopen("rm -rf /boot/linuxrootfs%s" % slot) else: emptySlot(slot) self.getImagelist() From 5b28328e98013520690f82583df0973f82e1c960 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 16:53:21 +0200 Subject: [PATCH 178/203] [LogManager] -PEP8 cleanup --- lib/python/Screens/LogManager.py | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/python/Screens/LogManager.py b/lib/python/Screens/LogManager.py index cf4232b3e72..eff1bac0a95 100644 --- a/lib/python/Screens/LogManager.py +++ b/lib/python/Screens/LogManager.py @@ -130,20 +130,20 @@ def JobTrash(self): class LogManager(Screen): def __init__(self, session): Screen.__init__(self, session) - self.logtype = 'crashlogs' + self.logtype = "crashlogs" - self['myactions'] = ActionMap(['ColorActions', 'OkCancelActions', 'DirectionActions'], + self["myactions"] = ActionMap(["ColorActions", "OkCancelActions", "DirectionActions"], { - 'ok': self.changeSelectionState, - 'cancel': self.close, - 'red': self.changelogtype, - 'green': self.showLog, - 'yellow': self.deletelog, + "ok": self.changeSelectionState, + "cancel": self.close, + "red": self.changelogtype, + "green": self.showLog, + "yellow": self.deletelog, "left": self.left, "right": self.right, "down": self.down, "up": self.up - }, -1) + }, -1) # noqa: E123 self["key_red"] = Button(_("Debug Logs")) self["key_green"] = Button(_("View")) @@ -217,14 +217,14 @@ def changeSelectionState(self): def changelogtype(self): self["LogsSize"].update(config.crash.debug_path.value) import re - if self.logtype == 'crashlogs': + if self.logtype == "crashlogs": self["key_red"].setText(_("Crash Logs")) - self.logtype = 'debuglogs' - self.matchingPattern = 'Enigma2_debug_' + self.logtype = "debuglogs" + self.matchingPattern = "Enigma2_debug_" else: self["key_red"].setText(_("Debug Logs")) - self.logtype = 'crashlogs' - self.matchingPattern = 'Enigma2_crash_' + self.logtype = "crashlogs" + self.matchingPattern = "Enigma2_crash_" self["list"].matchingPattern = re.compile(self.matchingPattern) self["list"].changeDir(self.defaultDir) @@ -372,14 +372,14 @@ def __init__(self, session, logpath=None): self["actions"] = ActionMap(["ChannelSelectBaseActions", "WizardActions", "DirectionActions", "MenuActions", "NumberActions", "ColorActions"], { - "ok": self.ok, - "back": self.exit, - "up": self.goUp, - "down": self.goDown, - "left": self.goLeft, - "right": self.goRight, - "0": self.doRefresh, - }, -1) + "ok": self.ok, + "back": self.exit, + "up": self.goUp, + "down": self.goDown, + "left": self.goLeft, + "right": self.goRight, + "0": self.doRefresh, + }, -1) # noqa: E123 self.onLayoutFinish.append(self.mainlist) def exit(self): From 070471fbf07d5f1299bfb0fab8bbe7e55bae9787 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 16:54:17 +0200 Subject: [PATCH 179/203] [Ikpg] -PEP8 cleanup --- lib/python/Screens/Ipkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/Ipkg.py b/lib/python/Screens/Ipkg.py index 8e9564a4986..e2390efcdeb 100644 --- a/lib/python/Screens/Ipkg.py +++ b/lib/python/Screens/Ipkg.py @@ -101,7 +101,7 @@ def ipkgCallback(self, event, param): elif event == IpkgComponent.EVENT_REMOVE: self.package.setText(param) self.status.setText(_("Removing")) - if not param in self.processed_packages: + if param not in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_CONFIGURING: From e6e51849f2514386635b1827a40cbf053fad27d6 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 16:57:05 +0200 Subject: [PATCH 180/203] [InputDeviceSetup] -PEP8 cleanup --- lib/python/Screens/InputDeviceSetup.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/python/Screens/InputDeviceSetup.py b/lib/python/Screens/InputDeviceSetup.py index 9bfae4b96fb..3042f63213f 100644 --- a/lib/python/Screens/InputDeviceSetup.py +++ b/lib/python/Screens/InputDeviceSetup.py @@ -28,16 +28,16 @@ def __init__(self, session): print(("[InputDeviceSetup] found devices :->", len(self.devices), self.devices)) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", - { - "cancel": (self.close, _("Exit input device selection.")), - "ok": (self.okbuttonClick, _("Select input device.")), - }, -2) + { + "cancel": (self.close, _("Exit input device selection.")), # noqa: E122 + "ok": (self.okbuttonClick, _("Select input device.")), # noqa: E122 + }, -2) self["ColorActions"] = HelpableActionMap(self, "ColorActions", - { - "red": (self.close, _("Exit input device selection.")), - "green": (self.okbuttonClick, _("Select input device.")), - }, -2) + { + "red": (self.close, _("Exit input device selection.")), # noqa: E122 + "green": (self.okbuttonClick, _("Select input device.")), # noqa: E122 + }, -2) self.currentIndex = 0 self.list = [] @@ -56,16 +56,16 @@ def buildInterfaceList(self, device, description, type, isinputdevice=True): if type is None: devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcold-configured.png")) elif type == 'remote': - if config.misc.rcused.value == 0: + if config.misc.rcused.value == 1: # default is 1 if enabled: - devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcnew-configured.png")) + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcold-configured.png")) else: - devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcnew.png")) + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcold.png")) else: if enabled: - devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcold-configured.png")) + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcnew-configured.png")) else: - devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcold.png")) + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_rcnew.png")) elif type == 'keyboard': if enabled: devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/input_keyboard-configured.png")) From 8d4c61d1f664fd976d1ed1d0c362c6241d91ee6c Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:03:39 +0200 Subject: [PATCH 181/203] [InfoBarGenerics] -PEP8 cleanup --- lib/python/Screens/InfoBarGenerics.py | 53 +++++++++++++-------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index b768dd03298..40f52d178cc 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -409,7 +409,7 @@ def __init__(self, session): "nextEvent": (self.nextEvent, _("Show description for next event)")), "timerAdd": (self.timerAdd, _("Add timer")), "openSimilarList": (self.openSimilarList, _("Show list of similar programs")), - }, prio=-1, description=_("Second infobar")) + }, prio=-1, description=_("Second infobar")) # noqa: E123 self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ @@ -614,7 +614,7 @@ def __init__(self): "LongOKPressed": (self.toggleShowLong, self._helpToggleShowLong), "toggleShow": (self.toggleShow, _("Cycle through infobar displays")), "hide": (self.keyHide, self._helpKeyHide), - }, prio=1, description=_("Show/hide infobar")) # lower prio to make it possible to override ok and cancel.. + }, prio=1, description=_("Show/hide infobar")) # noqa: E123 lower prio to make it possible to override ok and cancel.. self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ @@ -1110,7 +1110,7 @@ def __init__(self, session, number, searchNumberFunction=None): "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal - }) + }) # noqa: E123 self.Timer = eTimer() self.Timer.callback.append(self.keyOK) @@ -1134,7 +1134,7 @@ def __init__(self): "8": (self.keyNumberGlobal, _("Zap to channel number")), "9": (self.keyNumberGlobal, _("Zap to channel number")), "0": (self.keyNumberGlobal, self._helpKeyNumberGlobal0), - }, description=_("Recall channel, panic button & number zap")) + }, description=_("Recall channel, panic button & number zap")) # noqa: E123 def _helpKeyNumberGlobal0(self): if isinstance(self, InfoBarPiP) and self.pipHandles0Action(): @@ -1611,8 +1611,8 @@ def __init__(self): self.defaultEPGType = self.getDefaultEPGtype() self.defaultINFOType = self.getDefaultINFOtype() self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - iPlayableService.evUpdatedEventInfo: self.__evEventInfoChanged, - }) + iPlayableService.evUpdatedEventInfo: self.__evEventInfoChanged, + }) # Note regarding INFO button on the RCU. Some RCUs do not have an INFO button, but to make matters # more complicated they have an EPG button that sends KEY_INFO instead of KEY_EPG. To deal with @@ -1948,9 +1948,9 @@ def __init__(self): self.rass_interactive = None self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - iPlayableService.evEnd: self.__serviceStopped, - iPlayableService.evUpdatedRassSlidePic: self.RassSlidePicChanged - }) + iPlayableService.evEnd: self.__serviceStopped, + iPlayableService.evUpdatedRassSlidePic: self.RassSlidePicChanged + }) self["RdsActions"] = HelpableActionMap(self, ["InfobarRdsActions"], { @@ -3391,7 +3391,7 @@ def recordQuestionCallback(self, answer): # print("[InfoBarGenerics]test1") if answer is None or answer[1] == "no": - # print([InfoBarGenerics]"test2") + # print(["InfoBarGenerics]test2") return list = [] recording = self.recording[:] @@ -3799,8 +3799,8 @@ def __init__(self, session): self["actions"] = NumberActionMap(["InfobarVmodeButtonActions"], { - "vmodeSelection": self.selectVMode - }) + "vmodeSelection": self.selectVMode + }) # noqa: E123 self.Timer = eTimer() self.Timer.callback.append(self.quit) @@ -3933,13 +3933,10 @@ def __init__(self, actionmap="InfobarCueSheetActions"): self.resume_point = None self.force_next_resume = False self.__event_tracker = ServiceEventTracker(screen=self, - eventmap={ - iPlayableService.evStart: self.__serviceStarted, - iPlayableService.evCuesheetChanged: self.downloadCuesheet, - iPlayableService.evStopped: self.__evStopped, - } - ) - + eventmap={ + iPlayableService.evStart: self.__serviceStarted, + iPlayableService.evCuesheetChanged: self.downloadCuesheet, + iPlayableService.evStopped: self.__evStopped, }) self.__blockDownloadCuesheet = False self.__recording = None self.__recordingCuts = [] @@ -4141,7 +4138,7 @@ def getNearestCutPoint(self, pts, cmp=abs, start=False): def toggleMark(self, onlyremove=False, onlyadd=False, tolerance=5 * 90000, onlyreturn=False): current_pos = self.cueGetCurrentPosition() if current_pos is None: - # print("[InfoBarGenerics]not seekable") + # print("[InfoBarGenerics]not seekable") return nearest_cutpoint = self.getNearestCutPoint(current_pos) @@ -4245,10 +4242,10 @@ class InfoBarSummary(Screen): """ -# for picon: (path="piconlcd" will use LCD picons) -# -# Reference -# + # for picon: (path="piconlcd" will use LCD picons) + # + # Reference + # class InfoBarSummarySupport: @@ -4434,10 +4431,10 @@ def restartSubtitle(self): class InfoBarServiceErrorPopupSupport: def __init__(self): self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - iPlayableService.evTuneFailed: self.__tuneFailed, - iPlayableService.evTunedIn: self.__serviceStarted, - iPlayableService.evStart: self.__serviceStarted - }) + iPlayableService.evTuneFailed: self.__tuneFailed, + iPlayableService.evTunedIn: self.__serviceStarted, + iPlayableService.evStart: self.__serviceStarted + }) self.__serviceStarted() def __serviceStarted(self): From a99b078283efe6c5ce84aad61fe10a8254950d30 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:05:13 +0200 Subject: [PATCH 182/203] [GitCommitInfo] -PEP8 cleanup --- lib/python/Screens/GitCommitInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/GitCommitInfo.py b/lib/python/Screens/GitCommitInfo.py index bbe80ead2a1..67f32a55b69 100644 --- a/lib/python/Screens/GitCommitInfo.py +++ b/lib/python/Screens/GitCommitInfo.py @@ -186,7 +186,7 @@ def __init__(self, session): "down": self["AboutScrollLabel"].pageDown, "left": self.left, "right": self.right - } + } # noqa: E123 ) self["key_red"] = Button(_("Cancel")) From ad2a56c883a352bc319cb6008c30a2c46ebcfba0 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:05:57 +0200 Subject: [PATCH 183/203] [FixedMenu] -PEP8 cleanup --- lib/python/Screens/FixedMenu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/FixedMenu.py b/lib/python/Screens/FixedMenu.py index 7026a5c581b..a39b5e8cf8c 100644 --- a/lib/python/Screens/FixedMenu.py +++ b/lib/python/Screens/FixedMenu.py @@ -19,6 +19,6 @@ def __init__(self, session, title, list): { "ok": self.okbuttonClick, "cancel": self.close - }) + }) # noqa: E123 self["title"] = StaticText(title) From 5d9ad04127f6841feb608daaeee5de5d972ad4d4 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:08:30 +0200 Subject: [PATCH 184/203] [EventView] -PEP8 cleanup --- lib/python/Screens/EventView.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/python/Screens/EventView.py b/lib/python/Screens/EventView.py index 7dd5484401c..f090a120e3a 100644 --- a/lib/python/Screens/EventView.py +++ b/lib/python/Screens/EventView.py @@ -33,7 +33,7 @@ def __init__(self, session, menu): { "ok": self.okbuttonClick, "cancel": self.cancelClick - } + } # noqa: E123 ) self["menu"] = MenuList(menu) @@ -85,11 +85,11 @@ def __init__(self, event, ref, callback=None, similarEPGCB=None): "prevEvent": self.prevEvent, "nextEvent": self.nextEvent, "contextMenu": self.doContext, - }) - self['dialogactions'] = ActionMap(['WizardActions'], + }) # noqa: E123 + self["dialogactions"] = ActionMap(["WizardActions"], { - 'back': self.closeChoiceBoxDialog, - }, -1 + "back": self.closeChoiceBoxDialog, + }, -1 # noqa: E123 ) self['dialogactions'].csel = self self["dialogactions"].setEnabled(False) @@ -100,7 +100,7 @@ def onCreate(self): self.setEvent(self.event) def prevEvent(self): - if self.cbFunc is not None: + if self.cbFunc is not None: # noqa: E402 self.cbFunc(self.setEvent, self.setService, -1) def nextEvent(self): @@ -298,8 +298,7 @@ def __init__(self, session, event, ref, callback=None, singleEPGCB=None, multiEP { "timerAdd": self.timerAdd, "openSimilarList": self.openSimilarList, - } - ) + }) # noqa: E123 self["key_green"] = Button("") if singleEPGCB: @@ -307,8 +306,7 @@ def __init__(self, session, event, ref, callback=None, singleEPGCB=None, multiEP self["epgactions2"] = ActionMap(["EventViewEPGActions"], { "openSingleServiceEPG": singleEPGCB, - } - ) + }) # noqa: E123 else: self["key_yellow"] = Button("") self["yellow"].hide() @@ -318,8 +316,7 @@ def __init__(self, session, event, ref, callback=None, singleEPGCB=None, multiEP self["epgactions3"] = ActionMap(["EventViewEPGActions"], { "openMultiServiceEPG": multiEPGCB, - } - ) + }) # noqa: E123 else: self["key_blue"] = Button("") self["blue"].hide() From d23529b4e55ce011b33ffebf119e5dd4a94ff19b Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:10:15 +0200 Subject: [PATCH 185/203] [DVD] -PEP8 cleanup --- lib/python/Screens/DVD.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/python/Screens/DVD.py b/lib/python/Screens/DVD.py index 8eb3d993531..31730983e33 100644 --- a/lib/python/Screens/DVD.py +++ b/lib/python/Screens/DVD.py @@ -85,8 +85,7 @@ def __init__(self, session, number): "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal - } - ) + }) # noqa: E123 self.Timer = eTimer() self.Timer.callback.append(self.keyOK) @@ -192,14 +191,13 @@ def __init__(self, session, dvd_device=None, dvd_filelist=None, args=None): "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, - }) + }) # noqa: E123 self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, - } - ) + }) # noqa: E123 self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "DVDPlayerActions", { @@ -217,8 +215,7 @@ def __init__(self, session, dvd_device=None, dvd_filelist=None, args=None): "nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("switch to the next angle")), "seekBeginning": self.seekBeginning, - }, -2 - ) + }, -2) # noqa: E123 self["NumberActions"] = NumberActionMap(["NumberActions"], { @@ -232,8 +229,7 @@ def __init__(self, session, dvd_device=None, dvd_filelist=None, args=None): "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, - } - ) + }) # noqa: E123 self.onClose.append(self.__onClose) From f95e15540ef36f09761613cd13aa3b2a139edcde Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:10:52 +0200 Subject: [PATCH 186/203] [CronTimer] -PEP8 cleanup --- lib/python/Screens/CronTimer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/CronTimer.py b/lib/python/Screens/CronTimer.py index 2478b60797b..df5b4674150 100644 --- a/lib/python/Screens/CronTimer.py +++ b/lib/python/Screens/CronTimer.py @@ -54,7 +54,7 @@ def __init__(self, session): 'green': self.addtocron, 'yellow': self.CrondStart, 'blue': self.autostart, - }) + }) # noqa: E123 if self.selectionChanged not in self["list"].onSelectionChanged: self["list"].onSelectionChanged.append(self.selectionChanged) self.service_name = 'cronie' From e9851f8396cc17d8e291935e26576026d9091bf2 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:11:29 +0200 Subject: [PATCH 187/203] [CI] -PEP8 cleanup --- lib/python/Screens/Ci.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/Ci.py b/lib/python/Screens/Ci.py index ccbc499c8c6..821b0840bf2 100644 --- a/lib/python/Screens/Ci.py +++ b/lib/python/Screens/Ci.py @@ -107,7 +107,7 @@ def __init__(self, session, slotid, action, handler=eDVBCI_UI.getInstance(), wai "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal - }, -1) + }, -1) # noqa: E123 self.action = action self.screen_data = screen_data @@ -398,7 +398,7 @@ def __init__(self, session): "right": self.keyLeft, "ok": self.okbuttonClick, "cancel": self.cancel - }, -1) + }, -1) # noqa: E123 self["key_red"] = StaticText(_("Cancel")) self.dlg = None From 8daae4e7a2ca00705b4a41bcca6c91642587b16d Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:16:35 +0200 Subject: [PATCH 188/203] [ChannelSelection] -PEP8 cleanup --- lib/python/Screens/ChannelSelection.py | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 1d833ad5365..747f18090c3 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -73,7 +73,7 @@ def __init__(self, session, bouquets, selectedFunc, enableWrapAround=True): { "ok": self.okbuttonClick, "cancel": self.cancelClick - }) + }) # noqa: E123 entrys = [(x[0], x[1]) for x in bouquets] self["menu"] = MenuList(entrys, enableWrapAround) @@ -736,17 +736,17 @@ def __init__(self): self["ChannelSelectEPGActions"] = HelpableActionMap(self, ["ChannelSelectEPGActions"], { "showEPGList": (self.showEPGList, _("Show Single EPG")), - }, description=_("EPG access")) + }, description=_("EPG access")) # noqa: E123 self["recordingactions"] = HelpableActionMap(self, "InfobarInstantRecord", { "ShortRecord": (self.RecordTimerQuestion, _("Add a record timer")), - 'LongRecord': (self.doZapTimer, _('Add a zap timer for next event')) - }, prio=-1, description=_("Add timers")) - self['dialogactions'] = ActionMap(['OkCancelActions'], + "LongRecord": (self.doZapTimer, _("Add a zap timer for next event")) + }, prio=-1, description=_("Add timers")) # noqa: E123 + self["dialogactions"] = ActionMap(["OkCancelActions"], { - 'cancel': self.closeChoiceBoxDialog, - }) - self['dialogactions'].setEnabled(False) + "cancel": self.closeChoiceBoxDialog, + }) # noqa: E123 + self["dialogactions"].setEnabled(False) def getKeyFunctions(self, key): selection = eval("config.misc.ButtonSetup." + key + ".value.split(',')") @@ -840,13 +840,13 @@ def doInstantTimer(self, zap, eventIndex=0): if timer.eit == eventid and ':'.join(timer.service_ref.ref.toString().split(':')[:11]) == refstr: if eventIndex == 0: # Now - cb_func = lambda ret: self.removeTimer(timer) - menu = [(_("Yes"), 'CALLFUNC', cb_func), (_("No"), 'CALLFUNC', self.ChoiceBoxCB)] - self.ChoiceBoxDialog = self.session.instantiateDialog(MessageBox, text=_('Do you really want to remove the timer for %s?') % eventname, list=menu, skin_name="RemoveTimerQuestion", picon=False) + cb_func = lambda ret: self.removeTimer(timer) # noqa: E731 + menu = [(_("Yes"), "CALLFUNC", cb_func), (_("No"), "CALLFUNC", self.ChoiceBoxCB)] + self.ChoiceBoxDialog = self.session.instantiateDialog(MessageBox, text=_("Do you really want to remove the timer for %s?") % eventname, list=menu, skin_name="RemoveTimerQuestion", picon=False) else: # Next - cb_func1 = lambda ret: self.removeTimer(timer) - cb_func2 = lambda ret: self.editTimer(timer) + cb_func1 = lambda ret: self.removeTimer(timer) # noqa: E731 + cb_func2 = lambda ret: self.editTimer(timer) # noqa: E731 menu = [(_("Delete Timer"), 'CALLFUNC', self.RemoveTimerDialogCB, cb_func1), (_("Edit Timer"), 'CALLFUNC', self.RemoveTimerDialogCB, cb_func2)] self.ChoiceBoxDialog = self.session.instantiateDialog(ChoiceBox, title=_("Select action for timer %s:") % eventname, list=menu, keys=['green', 'blue'], skin_name="RecordTimerQuestion") selx, sely = self.servicelist.getSelectionPosition() @@ -904,7 +904,7 @@ def action(self, contexts, action): self["ChannelSelectEditActions"] = ChannelSelectionEditActionMap(self, ["ChannelSelectEditActions"], { "contextMenu": (self.doContext, _("Open menu")), - }, description=_("Menu")) + }, description=_("Menu")) # noqa: E123 def getMutableList(self, root=eServiceReference()): if self.mutableList is not None: @@ -1381,7 +1381,7 @@ def __init__(self, session): "8": (self.keyNumberGlobal, lambda: self._helpKeyNumberGlobal(8)), "9": (self.keyNumberGlobal, lambda: self._helpKeyNumberGlobal(9)), "0": (self.keyNumberGlobal, lambda: self._helpKeyNumberGlobal(0)), - }, prio=-1, description=_("Basic functions")) + }, prio=-1, description=_("Basic functions")) # noqa: E123 self.maintitle = _("Channel selection") self.recallBouquetMode() self.onShown.append(self.applyKeyMap) @@ -1846,7 +1846,7 @@ def keyNumberGlobal(self, number): self.servicelist.moveToChar(charstr[0]) def numberSelectionActions(self, number): - if not (hasattr(self, "movemode") and self.movemode): + if not (hasattr(self, "movemode") and self.movemode): # noqa: E275 if len(self.selectionNumber) > 4: self.clearNumberSelectionNumber() self.selectionNumber = self.selectionNumber + str(number) @@ -2023,7 +2023,7 @@ def __init__(self, session): "ok": self.channelSelected, "keyRadio": self.keyRadio, "keyTV": self.keyTV, - }) + }) # noqa: E123 self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evStart: self.__evServiceStart, @@ -2441,7 +2441,7 @@ def historyMenuClosed(self, retval): tmp = self.history[pos] del self.history[pos] self.history.append(tmp) - self.history_pos = len(self.history) - 1 + self.history_pos = len(self.history)-1 # noqa: E226 self.setHistoryPath() def saveRoot(self): @@ -2739,12 +2739,12 @@ def __init__(self, session, infobar): "cancel": self.cancel, "ok": self.channelSelected, "audio": self.audioSelection, - }) + }) # noqa: E123 self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - iPlayableService.evStart: self.__evServiceStart, - iPlayableService.evEnd: self.__evServiceEnd - }) + iPlayableService.evStart: self.__evServiceStart, + iPlayableService.evEnd: self.__evServiceEnd + }) # RDS Radiotext / Rass Support BEGIN self.infobar = infobar # reference to real infobar (the one and only) @@ -2884,7 +2884,7 @@ def __init__(self, session, title, currentBouquet=False): "ok": self.channelSelected, "keyRadio": self.setModeRadio, "keyTV": self.setModeTv, - }) + }) # noqa: E123 self.bouquet_mark_edit = OFF self.title = title self.currentBouquet = currentBouquet From 1b484382d6ef68fa6192086034d1a46968fee28c Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 17:18:06 +0200 Subject: [PATCH 189/203] [CCcamInfo] -PEP8 cleanup --- lib/python/Screens/CCcamInfo.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/python/Screens/CCcamInfo.py b/lib/python/Screens/CCcamInfo.py index 5f1ef10136e..b7f1442909f 100644 --- a/lib/python/Screens/CCcamInfo.py +++ b/lib/python/Screens/CCcamInfo.py @@ -433,7 +433,7 @@ def __init__(self, session): "down": self.down, "left": self.left, "right": self.right - }, -2) + }, -2) # noqa: E123 self.onLayoutFinish.append(self.updateMenuList) @@ -829,7 +829,7 @@ def __init__(self, session, info, set_title): "down": self["text"].pageDown, "left": self["text"].pageUp, "right": self["text"].pageDown, - }, -1) + }, -1) # noqa: E123 self["key_red"] = Label(_("Cancel")) self["shortcuts"] = ActionMap(["ShortcutActions"], @@ -1294,7 +1294,7 @@ def __init__(self, session): "green": self.new, "yellow": self.location, "blue": self.edit - }, -1) + }, -1) # noqa: E123 self.onLayoutFinish.append(self.readProfiles) @@ -1419,7 +1419,7 @@ def __init__(self, session, hostname, url): "green": self.uhopsMinus, "yellow": self.maxdownPlus, "blue": self.maxdownMinus - }, -1) + }, -1) # noqa: E123 self.onLayoutFinish.append(self.readShares) @@ -1551,7 +1551,7 @@ def __init__(self, session): "green": self.activate, "yellow": self.rename, "blue": self.showContent - }, -1) + }, -1) # noqa: E123 self.onLayoutFinish.append(self.showConfigs) @@ -1665,7 +1665,7 @@ def __init__(self, session): "red": self.close, "green": self.save, "yellow": self.location - }, -1) + }, -1) # noqa: E123 self.onLayoutFinish.append(self.showConfigs) From 8a0e9e0c164dff8109b38889d734399b81ce831a Mon Sep 17 00:00:00 2001 From: openvix-bot Date: Mon, 23 Oct 2023 15:21:07 +0000 Subject: [PATCH 190/203] PEP8 double aggressive E22, E224, E241, E242 and E27 --- lib/python/Screens/ChannelSelection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 747f18090c3..e4553ab8982 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -2441,7 +2441,7 @@ def historyMenuClosed(self, retval): tmp = self.history[pos] del self.history[pos] self.history.append(tmp) - self.history_pos = len(self.history)-1 # noqa: E226 + self.history_pos = len(self.history) - 1 # noqa: E226 self.setHistoryPath() def saveRoot(self): From 897ada4c0040e947542d5cdd0cd080e9e3ef1e05 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 19:57:31 +0200 Subject: [PATCH 191/203] [skin] put back removed scopes --- lib/python/skin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/skin.py b/lib/python/skin.py index c53690c9f73..0763fae9ef8 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -6,7 +6,7 @@ from Components.config import ConfigSubsection, ConfigText, config from Components.Sources.Source import ObsoleteSource from Components.SystemInfo import SystemInfo -from Tools.Directories import SCOPE_CURRENT_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_FONTS, SCOPE_SKIN, resolveFilename, fileReadXML, clearResolveLists +from Tools.Directories import SCOPE_CONFIG, SCOPE_CURRENT_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_FONTS, SCOPE_SKIN, SCOPE_SKIN_IMAGE, resolveFilename, fileReadXML, clearResolveLists from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap From 2b6d54cc2fb421ff530b09b8068999936b310f16 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 20:40:07 +0200 Subject: [PATCH 192/203] [skin] - PEP8 --- lib/python/skin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/skin.py b/lib/python/skin.py index 0763fae9ef8..8786606e583 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -6,7 +6,7 @@ from Components.config import ConfigSubsection, ConfigText, config from Components.Sources.Source import ObsoleteSource from Components.SystemInfo import SystemInfo -from Tools.Directories import SCOPE_CONFIG, SCOPE_CURRENT_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_FONTS, SCOPE_SKIN, SCOPE_SKIN_IMAGE, resolveFilename, fileReadXML, clearResolveLists +from Tools.Directories import SCOPE_CONFIG, SCOPE_CURRENT_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_FONTS, SCOPE_SKIN, SCOPE_SKIN_IMAGE, resolveFilename, fileReadXML, clearResolveLists # noqa: F401 from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap From f9a88fbc0b80e71b0fcb834cb94add382b3ef9f6 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 20:40:50 +0200 Subject: [PATCH 193/203] [StartEnigma] PEP8 --- lib/python/StartEnigma.py | 50 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index 39416d91416..cf9c3a0fdf5 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -17,32 +17,30 @@ class Session: - """ - Session.open: - * push current active dialog ("current_dialog") onto stack - * call execEnd for this dialog - * clear in_exec flag - * hide screen - * instantiate new dialog into "current_dialog" - * create screens, components - * read, apply skin - * create GUI for screen - * call execBegin for new dialog - * set in_exec - * show gui screen - * call components' / screen's onExecBegin - ... screen is active, until it calls "close"... - Session.close: - * assert in_exec - * save return value - * start deferred close handler ("onClose") - * execEnd - * clear in_exec - * hide screen - .. a moment later: - Session.doClose: - * destroy screen - """ + # Session.open: + # * push current active dialog ("current_dialog") onto stack + # * call execEnd for this dialog + # * clear in_exec flag + # * hide screen + # * instantiate new dialog into "current_dialog" + # * create screens, components + # * read, apply skin + # * create GUI for screen + # * call execBegin for new dialog + # * set in_exec + # * show gui screen + # * call components' / screen's onExecBegin + # ... screen is active, until it calls "close"... + # Session.close: + # * assert in_exec + # * save return value + # * start deferred close handler ("onClose") + # * execEnd + # * clear in_exec + # * hide screen + # .. a moment later: + # Session.doClose: + # * destroy screen def __init__(self, desktop=None, summary_desktop=None, navigation=None): self.desktop = desktop From 5cef0145cf7c96acad9587ec4d3bb1cf4cfb4054 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 20:47:14 +0200 Subject: [PATCH 194/203] [Wizard] PEP8 --- lib/python/Screens/Wizard.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py index 1e162cbf272..3be7ae13c25 100644 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -5,7 +5,7 @@ from boxbranding import getMachineBrand, getMachineName from Components.ActionMap import NumberActionMap -from Components.config import config, ConfigText, ConfigPassword, KEY_LEFT, KEY_RIGHT, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_ASCII +from Components.config import config, ConfigText, ConfigPassword, KEY_LEFT, KEY_RIGHT, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_ASCII # noqa: F401 from Components.ConfigList import ConfigList from Components.Label import Label from Components.Slider import Slider @@ -80,7 +80,7 @@ def startElement(self, name, attrs): if 'type' in attrs: if attrs["type"] == "dynamic": self.wizard[self.lastStep]["dynamiclist"] = attrs.get("source") - #self.wizard[self.lastStep]["list"].append(("Hallo", "test")) + # self.wizard[self.lastStep]["list"].append(("Hallo", "test")) if "evaluation" in attrs: # print("[Wizard] evaluation") self.wizard[self.lastStep]["listevaluation"] = attrs.get("evaluation") @@ -195,7 +195,7 @@ def __init__(self, session, showSteps=True, showStepSlider=True, showList=True, self.list = [] self["list"] = List(self.list, enableWrapAround=True) self["list"].onSelectionChanged.append(self.selChanged) - #self["list"] = MenuList(self.list, enableWrapAround = True) + # self["list"] = MenuList(self.list, enableWrapAround = True) self.onShown.append(self.updateValues) @@ -341,7 +341,7 @@ def finished(self, gotoStep=None, *args, **kwargs): else: self.currStep = self.getStepWithID(nextStep) - print_now = True + # print_now = True if (currStep == self.numSteps and self.wizard[currStep]["nextstep"] is None) or self.wizard[currStep]["id"] == "end": # wizard finished # print("[wizard]wizard finished") self.markDone() @@ -358,7 +358,7 @@ def finished(self, gotoStep=None, *args, **kwargs): self.onShown.remove(self.updateValues) # if print_now: - # print "Now: " + str(self.currStep) + # print("Now: " + str(self.currStep)) def ok(self): # print("[Wizard][OK] currstep, self.wizard", self.currStep, " ", self.wizard) @@ -419,7 +419,7 @@ def up(self): if "onselect" in self.wizard[self.currStep]: # print("[wizard][Wizard] current:", self["list"].current) self.selection = self["list"].current[-1] - #self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1] + # self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1] getattr(self, self.wizard[self.currStep]["onselect"])() # print("[wizard]up") @@ -429,14 +429,14 @@ def down(self): self["config"].instance.moveSelection(self["config"].instance.moveDown) self.handleInputHelpers() elif self.showList and len(self.wizard[self.currStep]["evaluatedlist"]) > 0: - #self["list"].instance.moveSelection(self["list"].instance.moveDown) + # self["list"].instance.moveSelection(self["list"].instance.moveDown) self["list"].selectNext() if "onselect" in self.wizard[self.currStep]: # print("[wizard]current:", self["list"].current) - #self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1] - #exec("self." + self.wizard[self.currStep]["onselect"] + "()") + # self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1] + # exec("self." + self.wizard[self.currStep]["onselect"] + "()") self.selection = self["list"].current[-1] - #self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1] + # self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1] getattr(self, self.wizard[self.currStep]["onselect"])() # print("[wizard]down") @@ -563,7 +563,7 @@ def afterAsyncCode(self): rootrenderer.instance.setZPosition(1) renderer = renderer.source - #self["list"].instance.setZPosition(1) + # self["list"].instance.setZPosition(1) self.list = [] if "dynamiclist" in self.wizard[self.currStep]: # print "dynamic list, calling", self.wizard[self.currStep]["dynamiclist"] From a6e425c3cec8b997c1d20c1be41e2ee2886c8c14 Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 21:00:45 +0200 Subject: [PATCH 195/203] [ChannelSelection] PEP8 --- lib/python/Screens/ChannelSelection.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index e4553ab8982..ca01a0fdd88 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -284,12 +284,13 @@ def __init__(self, session, csel): _append_when_current_valid(current, menu, actions, (_("Enable favourite edit"), self.bouquetMarkStart), level=0, key="yellow") if SystemInfo["PIPAvailable"]: if not self.parentalControlEnabled or self.parentalControl.getProtectionLevel(current.toCompareString()) == -1: -# if self.csel.dopipzap: -# _append_when_current_valid(current, menu, actions, (_("Play in main window"), self.playMain), level=0, key="red") -# else: - _append_when_current_valid(current, menu, actions, (_("Play as picture in picture"), self.showServiceInPiP), level=0, key="blue") -# _append_when_current_valid(current, menu, actions, (_("Find currently played service"), self.findCurrentlyPlayed), level=0, key="4") -# else: + _append_when_current_valid(current, menu, actions, (_("Play as picture in picture"), self.showServiceInPiP), level=0, key="blue") +# if self.csel.dopipzap: +# _append_when_current_valid(current, menu, actions, (_("Play in main window"), self.playMain), level=0, key="red") +# else: +# _append_when_current_valid(current, menu, actions, (_("Play as picture in picture"), self.showServiceInPiP), level=0, key="blue") +# _append_when_current_valid(current, menu, actions, (_("Find currently played service"), self.findCurrentlyPlayed), level=0, key="4") +# else: if self.parentalControlEnabled: if self.parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1: _append_when_current_valid(current, menu, actions, (_("Add to parental protection"), boundFunction(self.addParentalProtection, current)), level=0, key="bullet") @@ -1987,7 +1988,7 @@ def gotoCurrentServiceOrProvider(self, ref): HISTORYSIZE = 20 -#config for lastservice +# config for lastservice config.tv = ConfigSubsection() config.tv.lastservice = ConfigText() config.tv.lastroot = ConfigText() From 47d2173705cc750a8340105b8c87a57cef21c83f Mon Sep 17 00:00:00 2001 From: Twol Date: Mon, 23 Oct 2023 21:01:40 +0200 Subject: [PATCH 196/203] [InfoBarGeberics] - PEP8 --- lib/python/Screens/InfoBarGenerics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 40f52d178cc..f2e6941f50f 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -189,9 +189,9 @@ def streamrelayChecker(playref): if '%3a//' not in playrefstring and playrefstring in whitelist.streamrelay: url = "http://%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value) if "127.0.0.1" in url: - playrefmod = ":".join([("%x" % (int(x[1], 16) + 1)).upper() if x[0] == 6 else x[1] for x in enumerate(playrefstring.split(':'))]) + playrefmod = ":".join([("%x" % (int(x[1], 16) + 1)).upper() if x[0] == 6 else x[1] for x in enumerate(playrefstring.split(':'))]) else: - playrefmod = playrefstring + playrefmod = playrefstring playref = eServiceReference("%s%s%s:%s" % (playrefmod, url.replace(":", "%3a"), playrefstring.replace(":", "%3a"), ServiceReference(playref).getServiceName())) print("[Whitelist_StreamRelay] Play service via streamrelay as it is whitelisted as such", playref.toString()) return playref From c4bc3424b1e15fddf5e5b2645d33eb360400d81a Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 23 Oct 2023 21:41:10 +0200 Subject: [PATCH 197/203] [InputDeviceSetup] call newConfig on keySelect --- lib/python/Screens/InputDeviceSetup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/python/Screens/InputDeviceSetup.py b/lib/python/Screens/InputDeviceSetup.py index 3042f63213f..cb3a92f1692 100644 --- a/lib/python/Screens/InputDeviceSetup.py +++ b/lib/python/Screens/InputDeviceSetup.py @@ -190,6 +190,10 @@ def keyRight(self): ConfigListScreen.keyRight(self) self.newConfig() + def keySelect(self): + ConfigListScreen.keySelect(self) + self.newConfig() + def confirm(self, confirmed): if not confirmed: print("[InputDeviceSetup] not confirmed") From 7b6092fece8d9828e9297b782ee8b7b849b2fe3d Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 23 Oct 2023 21:52:22 +0200 Subject: [PATCH 198/203] [TimerEntryBase] add missing import --- lib/python/Screens/TimerEntryBase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Screens/TimerEntryBase.py b/lib/python/Screens/TimerEntryBase.py index a3ec4b6e1cb..9c9ab848899 100644 --- a/lib/python/Screens/TimerEntryBase.py +++ b/lib/python/Screens/TimerEntryBase.py @@ -8,7 +8,7 @@ from Screens.Setup import Setup from Screens.HelpMenu import HelpableScreen -from time import localtime, mktime, strftime +from time import localtime, mktime, strftime, time from datetime import datetime From 260220161fe23b7436f57a6d4a007df7b4158946 Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 23 Oct 2023 22:02:55 +0200 Subject: [PATCH 199/203] [ImageManager] missing import "copy" Removed in error: https://github.com/OpenViX/enigma2/commit/0c6460bb73be0ec5c5e5dfd6e1840e18f39b5294 Required here: https://github.com/OpenViX/enigma2/blob/0c6460bb73be0ec5c5e5dfd6e1840e18f39b5294/lib/python/Plugins/SystemPlugins/ViX/ImageManager.py#L1488 --- lib/python/Plugins/SystemPlugins/ViX/ImageManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Plugins/SystemPlugins/ViX/ImageManager.py b/lib/python/Plugins/SystemPlugins/ViX/ImageManager.py index 45824e8542a..c4e76d5c187 100644 --- a/lib/python/Plugins/SystemPlugins/ViX/ImageManager.py +++ b/lib/python/Plugins/SystemPlugins/ViX/ImageManager.py @@ -6,7 +6,7 @@ from boxbranding import getBoxType, getImageType, getImageDistro, getImageVersion, getImageBuild, getImageDevBuild, getImageFolder, getImageFileSystem, getBrandOEM, getMachineBrand, getMachineName, getMachineBuild, getMachineMake, getMachineMtdRoot, getMachineRootFile, getMachineMtdKernel, getMachineKernelFile, getMachineMKUBIFS, getMachineUBINIZE from enigma import eTimer, fbClass from os import path, stat, system, mkdir, makedirs, listdir, remove, rename, rmdir, sep as ossep, statvfs, chmod, walk -from shutil import copyfile, move, rmtree +from shutil import copy, copyfile, move, rmtree from time import localtime, time, strftime, mktime from Components.ActionMap import ActionMap From 47e8334fbd556a5081c0923ac21fda860b16ab1b Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 23 Oct 2023 22:03:53 +0200 Subject: [PATCH 200/203] [RestoreWizard] silence a warning --- lib/python/Plugins/SystemPlugins/ViX/RestoreWizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Plugins/SystemPlugins/ViX/RestoreWizard.py b/lib/python/Plugins/SystemPlugins/ViX/RestoreWizard.py index 286be9b05a1..fdfe977768f 100644 --- a/lib/python/Plugins/SystemPlugins/ViX/RestoreWizard.py +++ b/lib/python/Plugins/SystemPlugins/ViX/RestoreWizard.py @@ -45,7 +45,7 @@ def listDevices(self): mtimes = [] defaultprefix = getImageDistro()[4:] - for dir in ["/media/%s/backup" % media for media in listdir("/media/") if path.isdir(path.join("/media/", media))]: + for dir in ["/media/%s/backup" % media for media in listdir("/media/") if path.isdir(path.join("/media/", media))]: # noqa: F821 devmounts.append(dir) if len(devmounts): for devpath in devmounts: From 959a5418b677ffa0f5c35fa724f80348e189d33e Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 23 Oct 2023 22:13:48 +0200 Subject: [PATCH 201/203] [OSCamInfo] fix undefined name 'readers' --- lib/python/Screens/OScamInfo.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/python/Screens/OScamInfo.py b/lib/python/Screens/OScamInfo.py index 4f8b0fc25b8..6427b8bf0fe 100644 --- a/lib/python/Screens/OScamInfo.py +++ b/lib/python/Screens/OScamInfo.py @@ -377,9 +377,8 @@ def getClients(self): status = dataXML.find("status") clients = status.findall("client") for client in clients: - if "type" in client.attrib: - if client.attrib["type"] == "c": - readers.append((client.attrib["name"], client.attrib["name"])) # return tuple for later use in Choicebox + if "type" in client.attrib and client.attrib["type"] == "c": + clientnames.append((client.attrib["name"], client.attrib["name"])) # return tuple for later use in Choicebox return clientnames else: return None From 0d58641fda2fe9ff4352fcb1775378457d74c43f Mon Sep 17 00:00:00 2001 From: Huevos Date: Mon, 23 Oct 2023 22:17:33 +0200 Subject: [PATCH 202/203] [BackupManager] silence a warning --- lib/python/Plugins/SystemPlugins/ViX/BackupManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Plugins/SystemPlugins/ViX/BackupManager.py b/lib/python/Plugins/SystemPlugins/ViX/BackupManager.py index 4cc71c3ab1b..26fbe7064e1 100644 --- a/lib/python/Plugins/SystemPlugins/ViX/BackupManager.py +++ b/lib/python/Plugins/SystemPlugins/ViX/BackupManager.py @@ -656,7 +656,7 @@ def Stage3Complete(self, result, retval, extra_args): devmounts = [] self.plugfile = self.plugfiles[3] # print("[BackupManager] self.plugfile, self.plugfiles", self.plugfile, self.plugfiles) - for dir in ["/media/%s/%s" % (media, self.plugfile) for media in listdir("/media/") if path.isdir(path.join("/media/", media)) and path.exists("/media/%s/%s" % (media, self.plugfile))]: + for dir in ["/media/%s/%s" % (media, self.plugfile) for media in listdir("/media/") if path.isdir(path.join("/media/", media)) and path.exists("/media/%s/%s" % (media, self.plugfile))]: # noqa: F821 if media not in ("autofs", "net"): devmounts.append(dir) if len(devmounts): From 0d35994270321b80978e11ded13322da32fab45c Mon Sep 17 00:00:00 2001 From: openvix-build Date: Mon, 23 Oct 2023 23:24:56 +0000 Subject: [PATCH 203/203] openvix: developer 6.4.009.003 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index f52dc79e425..20f7f713d44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1186,3 +1186,4 @@ openvix: developer 6.4.008.012 openvix: developer 6.4.008.013 openvix: developer 6.4.009.001 openvix: developer 6.4.009.002 +openvix: developer 6.4.009.003