From e591c6449bc2289ba5a35fa09cca698c6968d638 Mon Sep 17 00:00:00 2001 From: oe-alliance-plugins python bot Date: Thu, 10 Aug 2023 15:25:37 +0000 Subject: [PATCH 01/17] PEP8 double aggressive E251 and E252 --- lcd4linux/src/plugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index e0f1c88..a30c9bc 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -8411,8 +8411,7 @@ def __init__(self, session): self.BitrateTimer.callback.append(self.runBitrateTimer) self.BitrateTimer.startLongTimer(30) - self.__event_tracker = ServiceEventTracker(screen = self, eventmap = - { + self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.restartTimer, iPlayableService.evUpdatedEventInfo: self.restartTimer, iPlayableService.evVideoSizeChanged: self.restartTimer From 089c3687c8de0d100123a621318e3f2d53bfedeb Mon Sep 17 00:00:00 2001 From: oe-alliance-plugins python bot Date: Thu, 10 Aug 2023 15:27:16 +0000 Subject: [PATCH 02/17] PEP8 double aggressive E301 ~ E306 --- lcd4linux/src/plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index a30c9bc..c4ce0d6 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -2377,6 +2377,7 @@ def Code_utf8(wert): wert = "" if wert is None else _unescape(wert) return wert.replace('\x86', '').replace('\x87', '') if PY3 else wert.replace('\xc2\x86', '').replace('\xc2\x87', '').decode("utf-8", "ignore") + def L4log(nfo, wert=""): if str(LCD4linux.EnableEventLog.value) != "0": print("[LCD4linux] %s %s" % (nfo, wert)) @@ -4683,6 +4684,8 @@ def dataAvail(self, data): pass # Grab + + def doGrab(i, ConfigFast, ConfigSize): if getFB2(True): setFB2("0") From e0f208507a39ed313260e1cf8f0c07e2809b470f Mon Sep 17 00:00:00 2001 From: oe-alliance-plugins python bot Date: Sat, 12 Aug 2023 15:26:31 +0000 Subject: [PATCH 03/17] PEP8 double aggressive E301 ~ E306 --- lcd4linux/src/plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index c4ce0d6..0c30ddd 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -5213,6 +5213,7 @@ def QuickBild(self, s): except Exception: pass + class LCDdisplayMenu(Screen): skin = """ From bb126cd29f3208de85a31ccba7433fa5ccbc0816 Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Sat, 2 Dec 2023 16:34:50 +0100 Subject: [PATCH 04/17] [LCD4linux] v5.0-r16 memory leak bugfixed - fixed slowing down of the box after a couple of hours (memory leak) --- lcd4linux/src/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 0c30ddd..9e59446 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -166,7 +166,7 @@ if find_library("usb-0.1") is not None or find_library("usb-1.0") is not None: print("[LCD4linux] libusb found :-)", getEnigmaVersionString()) USBok = True -Version = "V5.0-r15" +Version = "V5.0-r16" L4LElist = L4Lelement() L4LdoThread = True LCD4enigma2config = resolveFilename(SCOPE_CONFIG) # /etc/enigma2/ @@ -3099,9 +3099,9 @@ def writeHelligkeit(hell, night, STOP): if h3 == 0: R += "3" AktNight = night - if AktHelligkeit == [h1, h2, h3] + [L4LElist.getBrightness(0, False) and OSDtimer >= 0]: + if AktHelligkeit == [h1, h2, h3] + L4LElist.getBrightness(0, False) and OSDtimer >= 0: return R - AktHelligkeit = "%s %s" % ([h1, h2, h3], L4LElist.getBrightness(0, False)) + AktHelligkeit = [h1, h2, h3] + L4LElist.getBrightness(0, False) L4LElist.resetBrightness([h1, h2, h3]) L4log("write Bright", AktHelligkeit) if SamsungDevice is not None and LCD4linux.LCDType1.value[0] == "1": From 3c74b3bc83eb850bc49407c15c272c331eca0a30 Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Sun, 3 Dec 2023 00:33:29 +0100 Subject: [PATCH 05/17] [LCD4linux] revert commit 1df1cc0 --- lcd4linux/src/module.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lcd4linux/src/module.py b/lcd4linux/src/module.py index 0b0a1e9..4d5a0b6 100644 --- a/lcd4linux/src/module.py +++ b/lcd4linux/src/module.py @@ -3,6 +3,7 @@ # by joergm6 @ IHAD # for documentation look at IHAD Support Thread +from __future__ import print_function from os import popen from os.path import isfile, exists @@ -53,7 +54,7 @@ def get(self, element=None): def web(self, EX): try: exec("self.add('%s)" % EX.replace(",", "',", 1)) - except: + except Exception: print("[LCD4linuxE] Error: L4L Web-Elements") def getResolution(self, LCD): @@ -109,7 +110,7 @@ def setScreen(self, S, Lcd="", Hold=False): L4Lelement.Hold = Hold L4Lelement.Refresh = True - def resetBrightness(self, AKT=[]): + def resetBrightness(self, AKT=""): if len(AKT) == 3: L4Lelement.BrightAkt = AKT else: @@ -122,10 +123,10 @@ def setBrightness(self, LCD, BRI=-1): L4Lelement.Refresh = True def getBrightness(self, LCD=0, ORG=True): - if LCD > 0 and LCD < 4: - return L4Lelement.Bright[LCD - 1] if ORG == False else L4Lelement.BrightAkt[LCD - 1] + if int(LCD) > 0 and int(LCD) < 4: + return L4Lelement.Bright[int(LCD) - 1] if ORG == False else L4Lelement.BrightAkt[int(LCD) - 1] else: - return L4Lelement.Bright[0] if ORG == False else L4Lelement.BrightAkt[0] + return L4Lelement.Bright if ORG == False else L4Lelement.BrightAkt def getLcd(self): return L4Lelement.LCD @@ -146,7 +147,7 @@ def getstatusoutput(cmd): sts = 0 if text[-1:] == '\n': text = text[:-1] - except: + except Exception: sts = 1 text = "- -" print("[LCD4linux] Error on os-call") @@ -173,6 +174,6 @@ def L4LVtest(VV): f = open(L4Linfo % (O, P)) OO = f.readline().strip().split()[1].startswith(VV[1:]) f.close() - except: + except Exception: pass return OO From 4d0a16c32a83a3481308b4c1c7a6285b619ef2e6 Mon Sep 17 00:00:00 2001 From: jbleyel Date: Mon, 4 Dec 2023 17:51:35 +0100 Subject: [PATCH 06/17] [LCD4Linux] * use BoxInfo instead of boxbranding --- lcd4linux/src/plugin.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 9e59446..40b1f9e 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -97,6 +97,19 @@ from Tools.BoundFunction import boundFunction from Tools.Directories import SCOPE_PLUGINS, SCOPE_CONFIG, SCOPE_FONTS, SCOPE_LIBDIR, SCOPE_SYSETC, resolveFilename + +try: + from Components.SystemInfo import BoxInfo + IMAGEDISTRO = BoxInfo.getItem("distro") + MODEL = BoxInfo.getItem("machinebuild") + ARCH = BoxInfo.getItem("architecture") +except: + from boxbranding import getImageDistro, getBoxType, getImageArch + IMAGEDISTRO = getImageDistro() + MODEL = getBoxType() + ARCH = getImageArch() + + # PLUGIN IMPORTS from . import Photoframe, dpf, _ # for localized messages from .bluesound import BlueSound @@ -2529,6 +2542,8 @@ def L4LoadNewConfig(cfg): if isfile(LCD4default): LCD4linux.loadFromFile(LCD4default) L4log("Config-Load", cfg) + if MODEL == 'vuduo2': # due to 2 displays, LCD4linux is integrated in this boximage + LCD4linux.loadFromFile("%sdefault.vuduo2" % LCD4data) L4log("Config-Load for 'Vu+ duo²'", cfg) LCD4linux.loadFromFile(cfg) LCD4linux.load() @@ -15518,7 +15533,7 @@ def autostart(reason, **kwargs): def setup(menuid, **kwargs): - return [("LCD4Linux", main, "lcd4linux", None)] if menuid == "setup" else [] + return [("LCD4Linux", main, "lcd4linux", None)] if menuid == "setup" else [] def Plugins(**kwargs): From 939f32b800982233f032c77180074f9b69148813 Mon Sep 17 00:00:00 2001 From: jbleyel Date: Wed, 13 Dec 2023 13:59:30 +0100 Subject: [PATCH 07/17] [LCD4Linux] * add ScreenSummary --- lcd4linux/src/data/skin_data.xml | 4 ++++ lcd4linux/src/plugin.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lcd4linux/src/data/skin_data.xml b/lcd4linux/src/data/skin_data.xml index f473969..672a2e0 100644 --- a/lcd4linux/src/data/skin_data.xml +++ b/lcd4linux/src/data/skin_data.xml @@ -48,6 +48,10 @@ + + + + diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 40b1f9e..7a2fbd6 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -234,7 +234,7 @@ OSDon = 0 OSDtimer = -5 OSDdontshow = ["LCD4linux Settings", "Virtual Zap", "InfoBar", "Infobar", "SecondInfoBar", "FanControl2", "Mute", "LCD Text", "UnhandledKey", "QuickZap", "Volume", "PVRState"] -OSDdontskin = ["LCDdisplayFile", "VirtualZap", "InfoBar", "Infobar", "InfoBarSummary", "PictureInPicture", "SimpleSummary", "TimeshiftState", "InfoScreen", "Standby", "EMCMediaCenter", "InfoBarMoviePlayerSummary", "PVRState", "ResolutionLabel", "WidgetBackground", "camodogFSScreen2", "camodogFSmini"] +OSDdontskin = ["LCDdisplayFile", "VirtualZap", "InfoBar", "Infobar", "InfoBarSummary", "PictureInPicture", "SimpleSummary", "ScreenSummary", "TimeshiftState", "InfoScreen", "Standby", "EMCMediaCenter", "InfoBarMoviePlayerSummary", "PVRState", "ResolutionLabel", "WidgetBackground", "camodogFSScreen2", "camodogFSmini"] wwwWetter = ["", ""] WetterTypeX = ["", ""] WetterZoomX = [0, 0] From b39bb6988f1e2e029d187c572bf47a8607619fdc Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Sat, 6 Jan 2024 18:41:20 +0100 Subject: [PATCH 08/17] [LCD4linux] v5.0-r17 bugfix & improvement - bugfix: selected color of calendar column 'Saturday' and 'Sunday' is acting now correctly - improvement safer handling of MSN 'windy-flag' (sometimes it exists - sometimes not) HINT: LCD4linux is still working under Python2 and Python3 --- lcd4linux/src/plugin.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 7a2fbd6..23d8c2a 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -22,7 +22,6 @@ from __future__ import print_function, absolute_import, division from base64 import b64encode from calendar import Calendar, mdays, weekday, weekheader, month_name -from codecs import decode from colorsys import rgb_to_hls, hls_to_rgb from ctypes.util import find_library from datetime import datetime, timedelta, date @@ -179,7 +178,7 @@ if find_library("usb-0.1") is not None or find_library("usb-1.0") is not None: print("[LCD4linux] libusb found :-)", getEnigmaVersionString()) USBok = True -Version = "V5.0-r16" +Version = "V5.0-r17" L4LElist = L4Lelement() L4LdoThread = True LCD4enigma2config = resolveFilename(SCOPE_CONFIG) # /etc/enigma2/ @@ -9867,7 +9866,7 @@ def getCityCoords(self, ConfigWWW, jsonData): def downloadMSNcallback(self, ConfigWWW, jsonData): iconmap = {"d000": "32", "d100": "34", "d200": "30", "d210": "12", "d211": "5", "d212": "14", "d220": "11", "d221": "42", - "d222": "16", "d240": "4", "d300": "28", "d310": "11", "d311": "5", "d312": "14", "d320": "39", "d321": "5", + "d222": "16", "d240": "4", "d300": "28", "d310": "11", "d311": "5", "d312": "14", "d320": "39", "d321": "5", "d322": "16", "d340": "4", "d400": "26", "d410": "9", "d411": "5", "d412": "14", "d420": "9", "d421": "5", "d422": "16", "d430": "12", "d431": "5", "d432": "15", "d440": "4", "d500": "28", "d600": "20", "d603": "10", "d605": "17", "d705": "17", "d900": "21", "d905": "17", "d907": "21", "n000": "31", "n100": "33", "n200": "29", @@ -9907,7 +9906,7 @@ def downloadMSNcallback(self, ConfigWWW, jsonData): else: self.WDay[ConfigWWW]["Wind"] = "%.1f m/s %s" % (current.get("windSpd", 0) / 3.6, getDirection(current.get("windDir", "na"))) self.WDay[ConfigWWW]["Cond"] = current.get("pvdrCap", "") - self.WDay[ConfigWWW]["Icon"] = "%s.png" % iconmap.get(current.get("symbol", "")[:-1], "NA") # reduce MSN-code by 'windy'-flag + self.WDay[ConfigWWW]["Icon"] = "%s.png" % iconmap.get(current.get("symbol", "")[:4], "NA") # remove 'windy-flag' if present self.WDay[ConfigWWW]["Feel"] = "%.0f" % current.get("feels", 0) self.WDay[ConfigWWW]["Rain"] = "%.0f" % forecast[0].get("daily", {}).get("day", {}).get("precip", 0) self.WWeek[ConfigWWW] = [] @@ -9916,7 +9915,7 @@ def downloadMSNcallback(self, ConfigWWW, jsonData): Low = "%.0f" % forecast[idx].get("daily", {}).get("tempLo", 0) date = (currdate + timedelta(days=idx)).strftime("%Y-%m-%d") Day = datetime(int(date[:4]), int(date[5:7]), int(date[8:])).strftime("%a") - Icon = "%s.png" % iconmap.get(forecast[idx].get("daily", {}).get("symbol", "")[:-1], "NA") # reduce MSN-code by 'windy'-flag + Icon = "%s.png" % iconmap.get(forecast[idx].get("daily", {}).get("symbol", "")[:4], "NA") # remove 'windy-flag' if present Cond = forecast[idx].get("daily", {}).get("pvdrCap", "") Regen = "%.0f" % forecast[idx].get("daily", {}).get("day", {}).get("precip", 0) self.WWeek[ConfigWWW].append({"High": High, "Low": Low, "Day": Day, "Icon": Icon, "Cond": Cond, "Regen": Regen}) @@ -14204,7 +14203,7 @@ def putCalendar(workaround, draw, im): if ConfigLayout in ["0", "2"]: if datetime.now().day == day[0]: self.draw[4].rectangle((PX1 - w1, POSY, PX1 + w1, POSY + h), fill=ConfigBackColor) - ShadowText(4, PX, POSY, Tag, font, ConfigColor if day[1] < 5 else LCD4linux.CalSaColor.value, ConfigShadow) + ShadowText(4, PX, POSY, Tag, font, ConfigColor if day[1] < 5 else LCD4linux.CalSaColor.value if day[1] == 5 else LCD4linux.CalSuColor.value, ConfigShadow) if ConfigLayout in ["0"] and ICS.get(ICStag, None) is not None: self.draw[4].rectangle((PX1 - w1, POSY, PX1 + w1, POSY + h), outline=CC[int(ICS[ICStag][0][2])]) if int(LCD4linux.CalLine.value) > 1: @@ -14217,7 +14216,7 @@ def putCalendar(workaround, draw, im): if int(LCD4linux.CalLine.value) > 1: self.draw[4].rectangle((PX1 - w1, POSY + h, PX1 + w1, POSY + h), outline=ConfigBackColor) else: - ShadowText(4, PX, POSY, Tag, font, ConfigColor if day[1] < 5 else LCD4linux.CalSaColor.value, ConfigShadow) + ShadowText(4, PX, POSY, Tag, font, ConfigColor if day[1] < 5 else LCD4linux.CalSaColor.value if day[1] == 5 else LCD4linux.CalSuColor.value, ConfigShadow) if ConfigLayout in ["1", "2"] and ICS.get(ICStag, None) is not None: self.draw[4].rectangle((PX1 - w1, POSY + h, PX1 + w1, POSY + h), outline=CC[int(ICS[ICStag][0][2])]) if int(LCD4linux.CalLine.value) > 1: From 3f738a27278278c7ba64e715e5a094226d7ce830 Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Tue, 12 Mar 2024 18:37:52 +0100 Subject: [PATCH 09/17] [LCD4linux] v5.0-r18 weather display & options improved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **plugin.py:** - size/position calculations/alignment adjusted for the weather type "Current" and others - new setting 'Weather Humidity Color' added - trend arrow corrected for moon illumination (the trend arrow '●' is permanently shown at 0%) - immediate call-up of the weather due to 'NETworkCheckEnable=False' (per default) - improved error logging - removed DPKG ('Components.Network.iNetworkInfo' is not available in OpenATV) - some tiny code improvements / corrections - all translations modified accordingly **WebConfigSite.py:** - no more reloading of the weather after changes in the WebIF (commented out 'resetWetter(None)') - some tiny code improvements / corrections - all translations modified accordingly Special thanks for testing to **Turbohai@OpenATV** HINT: LCD4linux is still working under Python2 and Python3 --- lcd4linux/src/WebConfigSite.py | 16 +- lcd4linux/src/plugin.py | 636 ++++++++++++++------------------- 2 files changed, 277 insertions(+), 375 deletions(-) diff --git a/lcd4linux/src/WebConfigSite.py b/lcd4linux/src/WebConfigSite.py index 531101f..a4bf105 100644 --- a/lcd4linux/src/WebConfigSite.py +++ b/lcd4linux/src/WebConfigSite.py @@ -76,10 +76,7 @@ class LCD4linuxConfigweb(resource.Resource): def __init__(self): self.StatusTimer = eTimer() - if DPKG: - self.StatusTimer_conn = self.StatusTimer.timeout.connect(self.resetWeb) - else: - self.StatusTimer.callback.append(self.resetWeb) + self.StatusTimer.callback.append(self.resetWeb) self.CurrentMode = ("-", "-") def resetWeb(self): @@ -328,7 +325,6 @@ def action(self, req): obja = eval(a) objb = eval(b) objb.value = obja.value - elif ".Standby" in _a: b = _a.replace(".Standby", ".") if (" " + b) in list(zip(*L2))[2]: @@ -428,7 +424,8 @@ def action(self, req): if Cfritz: rmFile(PICfritz) if Cwetter: - resetWetter(None) +# resetWetter(None) # action after changing weather parameters + pass if Cpicon: if len(LCD4linux.PiconCache.value) > 2: rmFiles(join(LCD4linux.PiconCache.value, "*.png")) @@ -508,18 +505,14 @@ def action(self, req): html += "\n" % _l(_("Save Config")) html += "\n" html += "
%s\n" % _l(_("Screen")) - html += "\n" for i in range(1, 10): html += "\n" % (i, AktiveScreen(str(i)), i) - Aktiv = "checked" if getSaveEventListChanged() else "" html += "" % ("unchecked") html += "" % (_l(_("stop Screencycle")), "checked", Aktiv) - html += "
\n" html += "\n" - html += "
" html += "
" html += "%s \n" % _l(_("Mode")) @@ -532,7 +525,6 @@ def action(self, req): if str(LCD4linux.Popup.value) != "0": html += "\n" % (AktiveMode("5", "Popup-Text")) html += "
\n" - if Mode != "5": if Mode == "1": L = L1 @@ -595,9 +587,7 @@ def action(self, req): for LL in L: Conf = LL[2].strip() ConfObj = eval(Conf) - if (Conf.startswith(Element) and (LL[3] == AktCode or AktCode == 0)) or (Element == "other" and LL[3] == 0): - if Mode in "2": if "." in Conf: b = Conf.replace(".", ".MP") diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 23d8c2a..9ba84df 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -47,12 +47,12 @@ from re import findall, sub from requests import post, get, exceptions from simplejson import loads +from six import BytesIO, ensure_binary, ensure_str, PY3 from six.moves.queue import Queue from six.moves.socketserver import ThreadingMixIn from six.moves.urllib.parse import quote, urlparse, urlunparse from six.moves.urllib.request import urlopen, Request, urlretrieve from six.moves.BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler -from six import BytesIO, ensure_binary, ensure_str, PY3 from socket import setdefaulttimeout from struct import unpack from textwrap import TextWrapper, wrap @@ -81,6 +81,7 @@ from Components.Lcd import LCD from Components.MenuList import MenuList from Components.NimManager import nimmanager +from Components.Network import iNetwork from Components.Pixmap import Pixmap from Components.Renderer.Picon import getPiconName from Components.ServiceEventTracker import ServiceEventTracker @@ -132,13 +133,6 @@ else: from html import unescape as _unescape -try: - DPKG = True - from Components.Network import iNetworkInfo -except Exception: - DPKG = False - from Components.Network import iNetwork - try: from enigma import iDVBFrontend feCable = iDVBFrontend.feCable @@ -178,7 +172,7 @@ if find_library("usb-0.1") is not None or find_library("usb-1.0") is not None: print("[LCD4linux] libusb found :-)", getEnigmaVersionString()) USBok = True -Version = "V5.0-r17" +Version = "V5.0-r18" L4LElist = L4Lelement() L4LdoThread = True LCD4enigma2config = resolveFilename(SCOPE_CONFIG) # /etc/enigma2/ @@ -217,7 +211,7 @@ PIC3 = join(TMPL, "dpf3") PIC3tmp = join(TMPL, "dpf3tmp") PICcal = None -PICwetter = [False, False] +PICwetter = [None, None] PICmeteo = join(TMPL, "dpfmeteo.png") PICfritz = join(TMPL, "dpffritz.png") HTTPpic = "%sdpfhttp%%d.jpg" % TMPL @@ -235,8 +229,8 @@ OSDdontshow = ["LCD4linux Settings", "Virtual Zap", "InfoBar", "Infobar", "SecondInfoBar", "FanControl2", "Mute", "LCD Text", "UnhandledKey", "QuickZap", "Volume", "PVRState"] OSDdontskin = ["LCDdisplayFile", "VirtualZap", "InfoBar", "Infobar", "InfoBarSummary", "PictureInPicture", "SimpleSummary", "ScreenSummary", "TimeshiftState", "InfoScreen", "Standby", "EMCMediaCenter", "InfoBarMoviePlayerSummary", "PVRState", "ResolutionLabel", "WidgetBackground", "camodogFSScreen2", "camodogFSmini"] wwwWetter = ["", ""] -WetterTypeX = ["", ""] -WetterZoomX = [0, 0] +WetterType = ["", ""] +WetterZoom = [0, 0] OldTemp_c = -88 OldFeel = -88 OldHum = -88 @@ -421,7 +415,7 @@ LCD4linux.ServiceSearch = ConfigSelection(choices=[("0", _("Now/Next")), ("1", _("EPG"))], default="0") LCD4linux.ShowNoMsg = ConfigYesNo(default=True) LCD4linux.SavePicture = ConfigSelection(choices=[("0", _("no"))] + LCDSelect, default="123") -LCD4linux.NETworkCheckEnable = ConfigYesNo(default=True) +LCD4linux.NETworkCheckEnable = ConfigYesNo(default=False) LCD4linux.MJPEGenable1 = ConfigYesNo(default=False) LCD4linux.MJPEGenable2 = ConfigYesNo(default=False) LCD4linux.MJPEGenable3 = ConfigYesNo(default=False) @@ -458,6 +452,7 @@ LCD4linux.WetterRainColor = ConfigSelection(choices=Farbe, default="silver") LCD4linux.WetterRainColor2use = ConfigSelectionNumber(10, 100, 10, default=80) LCD4linux.WetterRainColor2 = ConfigSelection(choices=Farbe, default="cyan") +LCD4linux.WetterHumColor = ConfigSelection(choices=Farbe, default="cyan") LCD4linux.WetterLine = ConfigSelection(choices=[("false", _("no")), ("true", _("yes, short")), ("trueLong", _("yes, long"))], default="trueLong") LCD4linux.WetterTrendArrows = ConfigYesNo(default=True) LCD4linux.WetterExtra = ConfigYesNo(default=True) @@ -2519,12 +2514,8 @@ def setPopText(w): def resetWetter(wetter): global wwwWetter global PICwetter - if wetter is None: - wwwWetter = ["", ""] - PICwetter = [False, False] - else: - wwwWetter[wetter] = "" - PICwetter[wetter] = False + wwwWetter = ["", ""] + PICwetter = [None, None] def resetCal(): @@ -2845,15 +2836,15 @@ def ICSdownloads(): def getResolution(t, r): MAX_H, MAX_W = (0, 0) - if t[:1] == "5": + if t.startswith("5"): ttt = LCD4linux.xmlLCDType.value.split("x") MAX_W, MAX_H = int(ttt[0]), int(ttt[1]) if int(LCD4linux.xmlOffset.value) != 0: MAX_W -= (int(LCD4linux.xmlOffset.value) * 2) MAX_H -= (int(LCD4linux.xmlOffset.value) * 2) - elif t[1:] == "1": + elif t.endswith("1"): MAX_W, MAX_H = 320, 240 - elif t[1:] == "2": + elif t.endswith("2"): MAX_W, MAX_H = 240, 320 elif t[1:] in ["3", "4", "5", "10", "15"]: MAX_W, MAX_H = 800, 480 @@ -2861,24 +2852,24 @@ def getResolution(t, r): MAX_W, MAX_H = 800, 600 elif t[1:] in ["7", "8", "13", "14"]: MAX_W, MAX_H = 1024, 600 - elif t[1:] == "17": + elif t.endswith("17"): MAX_W, MAX_H = 220, 176 - elif t[1:] == "18": + elif t.endswith("18"): MAX_W, MAX_H = 255, 64 - elif t[1:] == "22": + elif t.endswith("22"): MAX_W, MAX_H = 480, 320 - elif t[1:] == "23": + elif t.endswith("23"): MAX_W, MAX_H = 800, 480 - elif t[1:] == "30": + elif t.endswith("30"): MAX_W, MAX_H = 400, 240 elif t == "320": MAX_W, MAX_H = LCD4linux.SizeW.value, LCD4linux.SizeH.value elif t == "420": MAX_W, MAX_H = LCD4linux.SizeW2.value, LCD4linux.SizeH2.value - elif t[1:] == "21": + elif t.endswith("21"): MAX_W, MAX_H = 128, 128 else: - MAX_W, MAX_H = 100, 100 + MAX_W, MAX_H = 132, 64 if r in ["90", "270"]: MAX_W, MAX_H = MAX_H, MAX_W return MAX_W, MAX_H @@ -3174,8 +3165,8 @@ def writeHelligkeit(hell, night, STOP): try: with open("/dev/lcd2", 'w') as led_fd: ioctl(led_fd, 0x10, H) - except Exception: - L4log("Error LCD Communication") + except Exception as err: + L4log("Error LCD Communication: %s" % str(err)) return R @@ -3220,8 +3211,8 @@ def writeLCD1(s, im, quality, SAVE=True): s.im[im].save(bild, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(bild): rename(bild, "%s.png" % PIC) - except Exception: - L4log("Error write Picture") + except Exception as err: + L4log("Error write Picture: %s" % str(err)) elif LCD4linux.LCDType1.value[0] == "3": L4log("writing Picture") try: @@ -3229,8 +3220,8 @@ def writeLCD1(s, im, quality, SAVE=True): s.im[im].save(datei, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(datei): rename(datei, "%s.%s" % (PIC, LCD4linux.BilderTyp.value)) - except Exception: - L4log("Error write Picture") + except Exception as err: + L4log("Error write Picture: %s" % str(err)) elif LCD4linux.LCDType1.value[0] == "4": L4log("writing TFT-LCD") try: @@ -3241,8 +3232,8 @@ def writeLCD1(s, im, quality, SAVE=True): s.im[im].save(bild, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(bild): rename(bild, "%s.png" % PIC) - except Exception: - L4log("Error write Picture") + except Exception as err: + L4log("Error write Picture: %s" % str(err)) elif LCD4linux.LCDType1.value[0] == "5": L4log("writing Internal-LCD") try: @@ -3269,16 +3260,16 @@ def writeLCD1(s, im, quality, SAVE=True): s.im[im].save(xmlPICtmp, "PNG") if isfile(xmlPICtmp): rename(xmlPICtmp, xmlPIC) - except Exception: - L4log("Error write Picture") + except Exception as err: + L4log("Error write Picture: %s" % str(err)) elif LCD4linux.LCDType1.value[0] == "9": L4log("writing to Vu+ LCD") try: s.im[im].save(bild, "PNG") if isfile(bild): rename(bild, "%s.png" % PIC) - except Exception: - L4log("Error write Picture") + except Exception as err: + L4log("Error write Picture: %s" % str(err)) if pngutil and pngutilconnect != 0: pngutil.send("%s.png" % PIC) else: @@ -3292,9 +3283,9 @@ def writeLCD1(s, im, quality, SAVE=True): output.close() try: Photoframe.write_jpg2frame(SamsungDevice, pic) - except Exception: + except Exception as err: SamsungDevice = None - L4log("Samsung 1 write Error") + L4log("Samsung 1 write Error: %s" % str(err)) if "1" in LCD4linux.SavePicture.value and SAVE == True: try: datei = "%s.jpg" % PICtmp @@ -3305,8 +3296,8 @@ def writeLCD1(s, im, quality, SAVE=True): open(datei, "wb").write(pic) if isfile(datei): rename(datei, "%s.jpg" % PIC) - except Exception: - L4log("Error write Picture") + except Exception as err: + L4log("Error write Picture: %s" % str(err)) if LCD4linux.MJPEGenable1.value == True: if MJPEG[0][1] == "a": MJPEG_stop(1) @@ -3340,8 +3331,8 @@ def writeLCD2(s, im, quality, SAVE=True): s.im[im].save(bild, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(bild): rename(bild, "%s.png" % PIC2) - except Exception: - L4log("Error write Picture2") + except Exception as err: + L4log("Error write Picture2: %s" % str(err)) elif LCD4linux.LCDType2.value[0] == "3": L4log("writing Picture2") try: @@ -3349,8 +3340,8 @@ def writeLCD2(s, im, quality, SAVE=True): s.im[im].save(datei, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(datei): rename(datei, "%s.%s" % (PIC2, LCD4linux.BilderTyp.value)) - except Exception: - L4log("Error write Picture2") + except Exception as err: + L4log("Error write Picture2: %s" % str(err)) elif LCD4linux.LCDType2.value[0] == "4": L4log("writing TFT-LCD2") try: @@ -3361,8 +3352,8 @@ def writeLCD2(s, im, quality, SAVE=True): s.im[im].save(bild, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(bild): rename(bild, "%s.png" % PIC2) - except Exception: - L4log("Error write Picture2") + except Exception as err: + L4log("Error write Picture2: %s" % str(err)) elif LCD4linux.LCDType2.value[0] == "5": L4log("writing Internal-LCD2") try: @@ -3389,16 +3380,16 @@ def writeLCD2(s, im, quality, SAVE=True): s.im[im].save(xmlPICtmp, "PNG") if isfile(xmlPICtmp): rename(xmlPICtmp, xmlPIC) - except Exception: - L4log("Error write Picture2") + except Exception as err: + L4log("Error write Picture2: %s" % str(err)) elif LCD4linux.LCDType2.value[0] == "9": L4log("writing to Vu+ LCD2") try: s.im[im].save(bild, "PNG") if isfile(bild): rename(bild, "%s.png" % PIC2) - except Exception: - L4log("Error write Picture2") + except Exception as err: + L4log("Error write Picture2: %s" % str(err)) if pngutil and pngutilconnect != 0: pngutil.send("%s.png" % PIC2) else: @@ -3425,8 +3416,8 @@ def writeLCD2(s, im, quality, SAVE=True): open(datei, "wb").write(pic) if isfile(datei): rename(datei, "%s.jpg" % PIC2) - except Exception: - L4log("Error write Picture2") + except Exception as err: + L4log("Error write Picture2: %s" % str(err)) if LCD4linux.MJPEGenable2.value == True: if MJPEG[0][1] == "b": MJPEG_stop(2) @@ -3460,8 +3451,8 @@ def writeLCD3(s, im, quality, SAVE=True): s.im[im].save(bild, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(bild): rename(bild, "%s.png" % PIC3) - except Exception: - L4log("Error write Picture3") + except Exception as err: + L4log("Error write Picture3: %s" % str(err)) elif LCD4linux.LCDType3.value[0] == "3": L4log("writing Picture3") try: @@ -3469,8 +3460,8 @@ def writeLCD3(s, im, quality, SAVE=True): s.im[im].save(datei, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(datei): rename(datei, "%s.%s" % (PIC3, LCD4linux.BilderTyp.value)) - except Exception: - L4log("Error write Picture3") + except Exception as err: + L4log("Error write Picture3: %s" % str(err)) elif LCD4linux.LCDType3.value[0] == "4": L4log("writing TFT-LCD3") try: @@ -3481,8 +3472,8 @@ def writeLCD3(s, im, quality, SAVE=True): s.im[im].save(bild, "PNG" if LCD4linux.BilderTyp.value == "png" else "JPEG") if isfile(bild): rename(bild, "%s.png" % PIC3) - except Exception: - L4log("Error write Picture3") + except Exception as err: + L4log("Error write Picture3: %s" % str(err)) elif LCD4linux.LCDType3.value[0] == "5": L4log("writing Internal-LCD3") try: @@ -3509,16 +3500,16 @@ def writeLCD3(s, im, quality, SAVE=True): s.im[im].save(xmlPICtmp, "PNG") if isfile(xmlPICtmp): rename(xmlPICtmp, xmlPIC) - except Exception: - L4log("Error write Picture3") + except Exception as err: + L4log("Error write Picture3: %s" % str(err)) elif LCD4linux.LCDType3.value[0] == "9": L4log("writing to Vu+ LCD3") try: s.im[im].save(bild, "PNG") if isfile(bild): rename(bild, "%s.png" % PIC3) - except Exception: - L4log("Error write Picture3") + except Exception as err: + L4log("Error write Picture3: %s" % str(err)) if pngutil and pngutilconnect != 0: pngutil.send("%s.png" % PIC3) else: @@ -3545,8 +3536,8 @@ def writeLCD3(s, im, quality, SAVE=True): open(datei, "wb").write(pic) if isfile(datei): rename(datei, "%s.jpg" % PIC3) - except Exception: - L4log("Error write Picture3") + except Exception as err: + L4log("Error write Picture3: %s" % str(err)) if LCD4linux.MJPEGenable3.value == True: if MJPEG[0][1] == "c": MJPEG_stop(3) @@ -4183,26 +4174,15 @@ def xmlClear(): def xmlRead(): global xmlList xmlList = [] - if isfile(join(LCD4enigma2config, "skin_user.xml")): - for i in open(LCD4enigma2config + "skin_user.xml").read().splitlines(): + xmlfile = join(LCD4enigma2config, "skin_user.xml") + if isfile(xmlfile): + for i in open(xmlfile).read().splitlines(): xmlList.append(i) if len(xmlList) > 1: while len(xmlList[-1]) < 2 and len(xmlList) > 1: del xmlList[-1] else: - sli = xmlReadData() - aw, ah = 0, 0 - ttt = [0] - for i in sli[0]: - ttt = LCD4linux.xmlLCDType.value.split("x") - aw, ah = 0, 0 - if LCD4linux.xmlLCDType.value == "96x64": - i = i.replace("\">", "\" id=\"2\">") - if getFB2(False): - if "PixmapLcd4linux" in i: - i = i.replace("0,0", "10,13") - aw, ah = 10, 171 - xmlList = ["\n".join(sli[0]).replace("$w$", str(int(ttt[0]) + aw)).replace("$h$", str(int(ttt[1]) + ah)), ""] + xmlList = ["", ""] def xmlReadData(): @@ -5457,34 +5437,21 @@ def __init__(self, session, args=0): self.mtime3 = 0.0 self.toggle = time() - 0.5 # delay in order to avoid GUI-start in mode 'idle' self.picload = ePicLoad() - if DPKG: - self.picload_conn = self.picload.PictureData.connect(self.setPictureCB) - else: - self.picload.PictureData.get().append(self.setPictureCB) + self.picload.PictureData.get().append(self.setPictureCB) sc = AVSwitch().getFramebufferScale() self.picload.setPara((pic_w, pic_h, sc[0], sc[1], False, 1, '#00000000')) self.picload2 = ePicLoad() - if DPKG: - self.picload2_conn = self.picload2.PictureData.connect(self.setPictureCB2) - else: - self.picload2.PictureData.get().append(self.setPictureCB2) + self.picload2.PictureData.get().append(self.setPictureCB2) sc = AVSwitch().getFramebufferScale() self.picload2.setPara((pic_w, pic_h, sc[0], sc[1], False, 1, '#00000000')) self.picload3 = ePicLoad() - if DPKG: - self.picload3_conn = self.picload3.PictureData.connect(self.setPictureCB3) - else: - self.picload3.PictureData.get().append(self.setPictureCB3) + self.picload3.PictureData.get().append(self.setPictureCB3) sc = AVSwitch().getFramebufferScale() self.picload3.setPara((pic_w, pic_h, sc[0], sc[1], False, 1, '#00000000')) ConfigListScreen.__init__(self, self.list, on_change=self.selectionChanged) self.PicTimer = eTimer() - if DPKG: - self.PicTimer_conn = self.PicTimer.timeout.connect(self.showpic) - else: - self.PicTimer.callback.append(self.showpic) - + self.PicTimer.callback.append(self.showpic) self["introduction"] = StaticText() self["Version"] = StaticText((Version if L4LElist.getVersion() == True else Version + "") + " (" + _("Mode") + ": Py" + ("3" if PY3 else "2") + ")") self["LibUSB"] = StaticText() @@ -5495,7 +5462,6 @@ def __init__(self, session, args=0): self["LCD1text"] = StaticText() self["LCD2text"] = StaticText() self["LCD3text"] = StaticText() - self["key_red"] = Button(_("Cancel")) self["key_green"] = Button(_("Save")) self["key_yellow"] = Button(_("Restart Displays")) @@ -5762,10 +5728,11 @@ def SetList(self): self.list1.append(getConfigListEntry(_("- Rain Color"), LCD4linux.WetterRainColor)) self.list1.append(getConfigListEntry(_("- Rain use Color 2 from"), LCD4linux.WetterRainColor2use)) self.list1.append(getConfigListEntry(_("- Rain Color 2"), LCD4linux.WetterRainColor2)) + self.list1.append(getConfigListEntry(_("Weather Humidity Color"), LCD4linux.WetterHumColor)) self.list1.append(getConfigListEntry(_("Weather Lines"), LCD4linux.WetterLine)) self.list1.append(getConfigListEntry(_("Weather Trendarrows"), LCD4linux.WetterTrendArrows)) self.list1.append(getConfigListEntry(_("Weather Extra Infos"), LCD4linux.WetterExtra)) - if LCD4linux.WetterExtra.value == True: + if LCD4linux.WetterExtra.value: self.list1.append(getConfigListEntry(_("- Extra Zoom"), LCD4linux.WetterExtraZoom)) self.list1.append(getConfigListEntry(_("- Show chill temperature from difference"), LCD4linux.WetterExtraFeel)) self.list1.append(getConfigListEntry(_("- Extra Color City"), LCD4linux.WetterExtraColorCity)) @@ -7861,7 +7828,7 @@ def keyOK(self): L4log("select File 5") self.session.openWithCallback(self.fileSelected, LCDdisplayFile, text=_("Choose file"), FileName=self["config"].getCurrent()[1].value, showFiles=True) except Exception as err: - L4log("Key-OK Config Fehler: %s" % err) + L4log("Key-OK Config Fehler: %s" % str(err)) def dirSelected(self, dir, dir1): if dir is None or dir1 is None: @@ -8054,12 +8021,12 @@ def selectionChanged(self): LCD4linux.Wetter2Coords.save() L4log("Weather2 city was changed from '%s' to '%s'" % (self.SaveWetter2, LCD4linux.Wetter2City.value)) resetWetter(1) - if LCD4linux.WetterIconZoom.isChanged() or LCD4linux.WetterRain.isChanged() or LCD4linux.WetterRainZoom.isChanged() or LCD4linux.WetterRainColor.isChanged() or LCD4linux.WetterRainColor2.isChanged() or LCD4linux.WetterRainColor2use.isChanged() or LCD4linux.WetterLine.isChanged() or LCD4linux.WetterTrendArrows.isChanged() or LCD4linux.WetterExtra.isChanged() or LCD4linux.WetterExtraColorFeel.isChanged() or LCD4linux.WetterExtraColorCity.isChanged() or LCD4linux.WetterExtraZoom.isChanged() or LCD4linux.WetterExtraFeel.isChanged() or LCD4linux.WetterWind.isChanged() or LCD4linux.WetterWindLines.isChanged() or LCD4linux.WetterLowColor.isChanged() or LCD4linux.WetterHighColor.isChanged() or LCD4linux.WetterTransparenz.isChanged(): - PICwetter = [False, False] + if LCD4linux.WetterIconZoom.isChanged() or LCD4linux.WetterRain.isChanged() or LCD4linux.WetterRainZoom.isChanged() or LCD4linux.WetterRainColor.isChanged() or LCD4linux.WetterRainColor2.isChanged() or LCD4linux.WetterRainColor2use.isChanged() or LCD4linux.WetterLine.isChanged() or LCD4linux.WetterTrendArrows.isChanged() or LCD4linux.WetterExtra.isChanged() or LCD4linux.WetterExtraColorFeel.isChanged() or LCD4linux.WetterExtraColorCity.isChanged() or LCD4linux.WetterExtraZoom.isChanged() or LCD4linux.WetterExtraFeel.isChanged() or LCD4linux.WetterWind.isChanged() or LCD4linux.WetterWindLines.isChanged() or LCD4linux.WetterLowColor.isChanged() or LCD4linux.WetterHighColor.isChanged() or LCD4linux.WetterTransparenz.isChanged() or LCD4linux.WetterHumColor.isChanged() or LCD4linux.WetterExtra.isChanged(): + PICwetter = [None, None] if LCD4linux.WetterZoom.isChanged() or LCD4linux.StandbyWetterZoom.isChanged() or LCD4linux.MPWetterZoom.isChanged() or LCD4linux.WetterType.isChanged() or LCD4linux.StandbyWetterType.isChanged() or LCD4linux.MPWetterType.isChanged() or LCD4linux.WetterColor.isChanged() or LCD4linux.StandbyWetterColor.isChanged() or LCD4linux.MPWetterColor.isChanged() or LCD4linux.WetterFont.isChanged() or LCD4linux.MPWetterFont.isChanged() or LCD4linux.StandbyWetterFont.isChanged() or LCD4linux.WetterShadow.isChanged() or LCD4linux.StandbyWetterShadow.isChanged() or LCD4linux.MPWetterShadow.isChanged(): - PICwetter[0] = False + PICwetter[0] = None if LCD4linux.Wetter2Zoom.isChanged() or LCD4linux.StandbyWetter2Zoom.isChanged() or LCD4linux.MPWetter2Zoom.isChanged() or LCD4linux.Wetter2Type.isChanged() or LCD4linux.StandbyWetter2Type.isChanged() or LCD4linux.MPWetter2Type.isChanged() or LCD4linux.Wetter2Color.isChanged() or LCD4linux.StandbyWetter2Color.isChanged() or LCD4linux.MPWetterColor.isChanged() or LCD4linux.Wetter2Font.isChanged() or LCD4linux.MPWetter2Font.isChanged() or LCD4linux.StandbyWetter2Font.isChanged() or LCD4linux.Wetter2Shadow.isChanged() or LCD4linux.StandbyWetter2Shadow.isChanged() or LCD4linux.MPWetter2Shadow.isChanged(): - PICwetter[1] = False + PICwetter[1] = None if self.SaveMeteo != LCD4linux.MeteoURL.value: self.SaveMeteo = LCD4linux.MeteoURL.value wwwMeteo = "" @@ -8115,6 +8082,7 @@ def LCDrestart(self): getSamsungDevice() TFTCheck(True) rmFile(CrashFile) + PICwetter = [None, None] rmFile("%stft.bmp" % TMPL) rmFiles(PIC + "*.*") if Briefkasten.qsize() <= 3: @@ -8231,7 +8199,6 @@ class UpdateStatus(Screen): def __init__(self, session): global ScreenActive Screen.__init__(self, session) - ScreenActive[0] = LCD4linux.ScreenActive.value self.NetatmoOK = NetatmoOK self.ServiceChangeRunning = False @@ -8378,10 +8345,7 @@ def __init__(self, session): self.NetworkConnectionAvailable = False try: if LCD4linux.NETworkCheckEnable.value == True: - if DPKG: - self.NetworkConnectionAvailable = iNetworkInfo.isConnected() - else: - iNetwork.checkNetworkState(self.checkNetworkCB) + iNetwork.checkNetworkState(self.checkNetworkCB) else: self.NetworkConnectionAvailable = None except Exception: @@ -8397,38 +8361,22 @@ def __init__(self, session): self.SonosTimer = eTimer() self.YMCastTimer = eTimer() self.BlueTimer = eTimer() - if DPKG: - self.StatusTimer_conn = self.StatusTimer.timeout.connect(self.updateStatus) - self.ServiceTimer_conn = self.ServiceTimer.timeout.connect(self.ServiceChange) - self.SamsungTimer_conn = self.SamsungTimer.timeout.connect(self.SamsungStart) - self.DpfTimer_conn = self.DpfTimer.timeout.connect(self.DpfStart) - self.QuickTimer_conn = self.QuickTimer.timeout.connect(self.QuickBildTimer) - self.CheckRefresh_conn = self.CheckRefresh.timeout.connect(self.CallCheckRefresh) - self.Later6Timer_conn = self.Later6Timer.timeout.connect(self.CallLater6) - self.SonosTimer_conn = self.SonosTimer.timeout.connect(self.getSonos) - self.YMCastTimer_conn = self.YMCastTimer.timeout.connect(self.getYMCast) - self.BlueTimer_conn = self.BlueTimer.timeout.connect(self.getBlue) - else: - self.StatusTimer.callback.append(self.updateStatus) - self.ServiceTimer.callback.append(self.ServiceChange) - self.SamsungTimer.callback.append(self.SamsungStart) - self.DpfTimer.callback.append(self.DpfStart) - self.QuickTimer.callback.append(self.QuickBildTimer) - self.CheckRefresh.callback.append(self.CallCheckRefresh) - self.Later6Timer.callback.append(self.CallLater6) - self.SonosTimer.callback.append(self.getSonos) - self.YMCastTimer.callback.append(self.getYMCast) - self.BlueTimer.callback.append(self.getBlue) + self.StatusTimer.callback.append(self.updateStatus) + self.ServiceTimer.callback.append(self.ServiceChange) + self.SamsungTimer.callback.append(self.SamsungStart) + self.DpfTimer.callback.append(self.DpfStart) + self.QuickTimer.callback.append(self.QuickBildTimer) + self.CheckRefresh.callback.append(self.CallCheckRefresh) + self.Later6Timer.callback.append(self.CallLater6) + self.SonosTimer.callback.append(self.getSonos) + self.YMCastTimer.callback.append(self.getYMCast) + self.BlueTimer.callback.append(self.getBlue) if GPjukeboxOK == True: CjukeboxEventNotifier.append(self.BPPlayerEvent) if BitrateRegistred == True: self.BitrateTimer = eTimer() - if DPKG: - self.BitrateTimer_conn = self.BitrateTimer.timeout.connect(self.runBitrateTimer) - else: - self.BitrateTimer.callback.append(self.runBitrateTimer) + self.BitrateTimer.callback.append(self.runBitrateTimer) self.BitrateTimer.startLongTimer(30) - self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.restartTimer, iPlayableService.evUpdatedEventInfo: self.restartTimer, @@ -8440,13 +8388,13 @@ def __init__(self, session): self.InstanceKeyPressed = eActionMap.getInstance().bindAction('', -0x7FFFFFFF, self.rcKeyPressed) self.recordtimer = session.nav.RecordTimer self.LastTimerlistUpdate = 0 - if str(LCD4linux.StandbyWetter.value) != "0" or str(LCD4linux.Wetter.value) != "0" or str(LCD4linux.MPWetter.value) != "0": + if (LCD4linux.StandbyWetter.value != "0" or LCD4linux.Wetter.value != "0" or LCD4linux.MPWetter.value != "0"): self.downloadWetter(LCD4linux.WetterCity.value, 0) - if str(LCD4linux.StandbyWetter2.value) != "0" or str(LCD4linux.Wetter2.value) != "0" or str(LCD4linux.MPWetter2.value) != "0": + if LCD4linux.StandbyWetter2.value != "0" or LCD4linux.Wetter2.value != "0" or LCD4linux.MPWetter2.value != "0": self.downloadWetter(LCD4linux.Wetter2City.value, 1) - if str(LCD4linux.StandbyMeteo.value) != "0" or str(LCD4linux.Meteo.value) != "0": + if LCD4linux.StandbyMeteo.value != "0" or LCD4linux.Meteo.value != "0": self.downloadMeteo() - if str(LCD4linux.ExternalIp.value) != "0" or str(LCD4linux.MPExternalIp.value) != "0" or str(LCD4linux.StandbyExternalIp.value) != "0": + if LCD4linux.ExternalIp.value != "0" or LCD4linux.MPExternalIp.value != "0" or LCD4linux.StandbyExternalIp.value != "0": self.ExternalIP = getExternalIP() self.timerlist = "" self.pluginlist = "" @@ -8499,10 +8447,7 @@ def onTunerCount(self): res_mgr = eDVBResourceManager.getInstance() if res_mgr: self.TunerCallBack = True - if DPKG: - self.frontendUseMaskChanged_conn = res_mgr.frontendUseMaskChanged.connect(self.tunerUseMaskChanged) - else: - res_mgr.frontendUseMaskChanged.get().append(self.tunerUseMaskChanged) + res_mgr.frontendUseMaskChanged.get().append(self.tunerUseMaskChanged) else: print("[ERROR]no res_mgr!!") @@ -8511,10 +8456,7 @@ def offTunerCount(self): res_mgr = eDVBResourceManager.getInstance() if res_mgr: self.TunerCallBack = False - if DPKG: - self.frontendUseMaskChanged_conn = None - else: - res_mgr.frontendUseMaskChanged.get().remove(self.tunerUseMaskChanged) + res_mgr.frontendUseMaskChanged.get().remove(self.tunerUseMaskChanged) else: print("[ERROR]no res_mgr!!") @@ -9003,10 +8945,10 @@ def updateStatus(self): self.SonosSoCo = None self.YMCastSoCo = None self.BlueSoCo = None - if str(LCD4linux.StandbyWetter.value) != "0" or str(LCD4linux.Wetter.value) != "0" or str(LCD4linux.MPWetter.value) != "0": + if LCD4linux.StandbyWetter.value != "0" or LCD4linux.Wetter.value != "0" or LCD4linux.MPWetter.value != "0": if strftime("%M") in ("35", "40", "55") or wwwWetter[0] == "": self.downloadWetter(LCD4linux.WetterCity.value, 0) - if str(LCD4linux.StandbyWetter2.value) != "0" or str(LCD4linux.Wetter2.value) != "0" or str(LCD4linux.MPWetter2.value) != "0": + if LCD4linux.StandbyWetter2.value != "0" or LCD4linux.Wetter2.value != "0" or LCD4linux.MPWetter2.value != "0": if strftime("%M") in ("35", "40", "55") or wwwWetter[1] == "": self.downloadWetter(LCD4linux.Wetter2City.value, 1) if strftime("%M") in LCD4linux.MailTime.value: @@ -9037,10 +8979,7 @@ def updateStatus(self): L4log("Error: Remove FritzCall", "%s" % FritzList) if self.NetworkConnectionAvailable is not None: L4log("check Network...") - if DPKG: - self.NetworkConnectionAvailable = iNetworkInfo.isConnected() - else: - iNetwork.checkNetworkState(self.checkNetworkCB) + iNetwork.checkNetworkState(self.checkNetworkCB) if str(LCD4linux.StandbyMeteo.value) != "0" or str(LCD4linux.Meteo.value) != "0": if divmod(int(strftime("%M")), 5)[1] == 0 or wwwMeteo.find("current_conditions") < 1: self.downloadMeteo() @@ -9403,16 +9342,10 @@ def runBitrateTimer(self): def stopBitrateData(self, TYP): L4logE("Bitrate Stop", TYP) if "V" in TYP and self.videoBitrate is not None: - if DPKG: - self.videoBitrate_conn = None - else: - self.videoBitrate.callback.remove(self.getVideoBitrateData) + self.videoBitrate.callback.remove(self.getVideoBitrateData) self.videoBitrate = None if "A" in TYP and self.audioBitrate is not None: - if DPKG: - self.audioBitrate_conn = None - else: - self.audioBitrate.callback.remove(self.getAudioBitrateData) + self.audioBitrate.callback.remove(self.getAudioBitrateData) self.audioBitrate = None def startBitrateData(self): @@ -9434,18 +9367,12 @@ def startBitrateData(self): apid = info.getInfo(iServiceInformation.sAudioPID) if vpid: self.videoBitrate = eBitrateCalculator(vpid, ref, 3000, 1024 * 1024) - if DPKG: - self.videoBitrate.callback = self.getVideoBitrateData - else: - self.videoBitrate.callback.append(self.getVideoBitrateData) + self.videoBitrate.callback.append(self.getVideoBitrateData) else: self.LvideoBitrate = "" if apid: self.audioBitrate = eBitrateCalculator(apid, ref, 3000, 64 * 1024) - if DPKG: - self.audioBitrate.callback = self.getVideoBitrateData - else: - self.audioBitrate.callback.append(self.getAudioBitrateData) + self.audioBitrate.callback.append(self.getAudioBitrateData) else: self.LaudioBitrate = "" else: @@ -9818,10 +9745,7 @@ def downloadWetter(self, ort, wetter): else: if self.NetworkConnectionAvailable is not None: L4log("Wetter%s: check Network..." % wetter) - if DPKG: - self.NetworkConnectionAvailable = iNetworkInfo.isConnected() - else: - iNetwork.checkNetworkState(self.checkNetworkCB) + iNetwork.checkNetworkState(self.checkNetworkCB) def downloadListError(self, error=""): L4log("Wetterdownload Error: %s" % error) @@ -9851,7 +9775,7 @@ def getCityCoords(self, ConfigWWW, jsonData): results = loads(jsonData).get("results", [None])[0] except Exception as err: self.WetterOK = False - L4log("Wetter%s-citysearch: invalid json data from MSN-server: %s" % (ConfigWWW, err)) + L4log("Wetter%s-citysearch: invalid json data from MSN-server: %s" % (ConfigWWW, str(err))) return if results: cityname = results["name"] if "name" in results else "" @@ -9884,7 +9808,7 @@ def downloadMSNcallback(self, ConfigWWW, jsonData): try: r = loads(jsonData).get("responses", [None])[0] except Exception as err: - L4log("MSN-weather%s: json-download Error: %s" % (ConfigWWW, err)) + L4log("MSN-weather%s: json-download Error: %s" % (ConfigWWW, str(err))) return L4log("MSN-weather%s data ready" % ConfigWWW) L4logE("MSN-weather%s data: {placeholder for a large json-string}" % ConfigWWW) @@ -9921,7 +9845,7 @@ def downloadMSNcallback(self, ConfigWWW, jsonData): self.WWeek[ConfigWWW].append({"High": High, "Low": Low, "Day": Day, "Icon": Icon, "Cond": Cond, "Regen": Regen}) L4log("MSN-weather%s: completed!" % ConfigWWW) self.downloadSunrise() - PICwetter[ConfigWWW] = False + PICwetter[ConfigWWW] = None else: L4log("MSN-weather%s download Error: no data found." % ConfigWWW) @@ -9938,7 +9862,7 @@ def downloadOMcallback(self, ConfigWWW, jsonData): try: r = loads(jsonData) except Exception as err: - L4log("OM-weather%s: json-download Error: %s" % (ConfigWWW, err)) + L4log("OM-weather%s: json-download Error: %s" % (ConfigWWW, str(err))) return L4log("OM-weather%s data ready" % ConfigWWW) L4logE("OM-weather%s data: %s" % (ConfigWWW, r)) @@ -9978,7 +9902,7 @@ def downloadOMcallback(self, ConfigWWW, jsonData): self.WWeek[ConfigWWW].append({"High": High, "Low": Low, "Day": Day, "Icon": Icon, "Cond": Cond, "Regen": Regen}) L4log("OM-weather%s: completed!" % ConfigWWW) self.downloadSunrise() - PICwetter[ConfigWWW] = False + PICwetter[ConfigWWW] = None else: L4log("OM-weather%s download Error: no data found." % ConfigWWW) @@ -9998,7 +9922,7 @@ def downloadOWMcallback(self, ConfigWWW, jsonData): try: r = loads(jsonData) except Exception as err: - L4log("OWM-weather%s: json-download Error: %s" % (ConfigWWW, err)) + L4log("OWM-weather%s: json-download Error: %s" % (ConfigWWW, str(err))) return L4log("OMW-weather%s data ready" % ConfigWWW) L4logE("OMW-weather%s data: %s" % (ConfigWWW, r)) @@ -10020,7 +9944,7 @@ def downloadOWMcallback(self, ConfigWWW, jsonData): self.WDay[ConfigWWW]["Feel"] = "%.0f" % r.get("main", {}).get("feels_like", 0) self.WDay[ConfigWWW]["Rain"] = "%.0f" % (r.get("pop", 0) * 100) self.WDay[ConfigWWW]["Wtime"] = strftime("%H:%M"), localtime(r.get("dt", time())) - PICwetter[ConfigWWW] = False + PICwetter[ConfigWWW] = None elif r.get("daily", None) is not None: self.WetterOK = True L4log("OWM-weather%s: analysing forecasts..." % ConfigWWW) @@ -10034,7 +9958,7 @@ def downloadOWMcallback(self, ConfigWWW, jsonData): Cond = current.get("weather", [{}])[0].get("description", "") Regen = "%.0f" % (current.get("pop", 0) * 100) self.WWeek[ConfigWWW].append({"High": High, "Low": Low, "Day": Day, "Icon": Icon, "Cond": Cond, "Regen": Regen}) - PICwetter[ConfigWWW] = False + PICwetter[ConfigWWW] = None L4log("OWM-weather%s: completed!" % ConfigWWW) self.downloadSunrise() else: @@ -10078,7 +10002,7 @@ def downloadWUcallback(self, ConfigWWW, jsonData): rain = "%.0f" % r.get("prob_precip_pct", 0) self.WDay[ConfigWWW]["Rain"] = rain if rain.isdigit() else "0" # could be: "< 1" self.WDay[ConfigWWW]["Wtime"] = strftime("%H:%M", localtime()) - PICwetter[ConfigWWW] = False + PICwetter[ConfigWWW] = None elif r.get("Days", None) is not None: self.WetterOK = True L4log("WU-weather%s: analysing forecasts..." % ConfigWWW) @@ -10101,7 +10025,7 @@ def downloadWUcallback(self, ConfigWWW, jsonData): self.WWeek[ConfigWWW].append({"High": High, "Low": Low, "Day": Day, "Icon": Icon, "Cond": Cond, "Regen": Regen}) L4log("WU-weather%s: completed!" % ConfigWWW) self.downloadSunrise() - PICwetter[ConfigWWW] = False + PICwetter[ConfigWWW] = None else: wwwWetter[ConfigWWW] = "" L4log("WU-weather%s download Error: no data found" % ConfigWWW) @@ -10454,10 +10378,7 @@ def getSplit(ConfigSplit, ConfigAlign, MAX_W, w): def getFont(num): ff = [FONT, LCD4linux.Font1.value, LCD4linux.Font2.value, LCD4linux.Font3.value, LCD4linux.Font4.value, LCD4linux.Font5.value] - if ff[int(num)].endswith(".ttf") and isfile(ff[int(num)]): - return ff[int(num)] - else: - return FONT + return ff[int(num)] if ff[int(num)].endswith(".ttf") and isfile(ff[int(num)]) else FONT def getMem(): @@ -10994,23 +10915,26 @@ def putWetter(workaround, draw, im): global OldFeel global OldHum global OldWind - MAX_W, MAX_H = (0, 0) + MAX_W, MAX_H = 0, 0 MAX_Wi, MAX_Hi = self.im[im].size if ConfigSplit == True: MAX_Wi = int(MAX_Wi / 2) Wim = 5 + int(ConfigWWW) - if PICwetter[ConfigWWW] is False or ConfigType != WetterTypeX[ConfigWWW] or ConfigZoom != WetterZoomX[ConfigWWW]: - PICwetter[ConfigWWW] = True + if PICwetter[ConfigWWW] is None or ConfigType != WetterType or ConfigZoom != WetterZoom: + PICwetter[ConfigWWW] = "wait" UseWetterPath = WetterPath if len(LCD4linux.WetterPath.value) > 2 and isfile(join(LCD4linux.WetterPath.value, "0.png")): UseWetterPath = LCD4linux.WetterPath.value - WetterTypeX[ConfigWWW] = ConfigType - WetterZoomX[ConfigWWW] = ConfigZoom + WetterType[ConfigWWW] = ConfigType + WetterZoom[ConfigWWW] = ConfigZoom POSX, POSY = 1, 0 Wmulti = ConfigZoom / 10.0 - if ConfigType[0] == "2": + largesize = ConfigType[0] != "3" + trendarrows = LCD4linux.WetterTrendArrows.value + MAX_Wr = 0 if trendarrows else int(12 * Wmulti) # reduce width of current weather frame when trendarrows are missing + if ConfigType.startswith("2"): MAX_H = int(175 * Wmulti) - elif ConfigType[0] == "4": + elif ConfigType.startswith("4"): MAX_H = int(25 * Wmulti) elif ConfigType == "5": MAX_H = int(54 * 6 * Wmulti) @@ -11020,27 +10944,34 @@ def putWetter(workaround, draw, im): MAX_H = int(80 * Wmulti) MAX_H += 2 if ConfigType == "1": - MAX_W = int(60 * 4 * Wmulti) + int(48 * 2 * Wmulti) + MAX_W = int(54 * 4 * Wmulti) + int(50 * 2 * Wmulti) - MAX_Wr + MAX_Wc = MAX_W elif ConfigType == "11": - MAX_W = int(60 * 5 * Wmulti) + int(48 * 2 * Wmulti) + MAX_W = int(54 * 5 * Wmulti) + int(50 * 2 * Wmulti) - MAX_Wr + MAX_Wc = MAX_W elif ConfigType == "12": - MAX_W = int(60 * 2 * Wmulti) + int(48 * 2 * Wmulti) - elif ConfigType == "22": - MAX_W = int(60 * 2 * Wmulti) + MAX_W = int(54 * 2 * Wmulti) + int(50 * 2 * Wmulti) - MAX_Wr + MAX_Wc = MAX_W elif ConfigType == "2": - MAX_W = int(60 * 4 * Wmulti) + MAX_W = int(55 * 4 * Wmulti) + MAX_Wc = int(50 * 2 * Wmulti) - MAX_Wr elif ConfigType == "21": - MAX_W = int(60 * 5 * Wmulti) + MAX_W = int(55 * 5 * Wmulti) + MAX_Wc = int(50 * 2 * Wmulti) - MAX_Wr + elif ConfigType == "22": + MAX_W = int(554 * 2 * Wmulti) + MAX_Wc = int(50 * 2 * Wmulti) - MAX_Wr elif ConfigType == "3": - MAX_W = int(60 * 2 * Wmulti) - elif ConfigType[0] == "4": - MAX_W = int(60 * Wmulti) - elif ConfigType[0] == "41": - MAX_W = int(60 * Wmulti) - elif ConfigType[0] == "5": - MAX_W = int(60 * 3 * Wmulti) + MAX_W = int(48 * 2 * Wmulti) - MAX_Wr + MAX_Wc = MAX_W + elif ConfigType.startswith("4"): + MAX_W = int(55 * Wmulti) + MAX_Wc = MAX_W + elif ConfigType.startswith("5"): + MAX_W = int(54 * 3 * Wmulti) + MAX_Wc = MAX_W POSX = int(54 * 2 * Wmulti) - POSY = int(54 * 2 * Wmulti) + POSY = int(40 * 2 * Wmulti) imageMode = "RGBA" if LCD4linux.WetterTransparenz.value == "true" else "RGB" self.im[Wim] = Image.new(imageMode, (MAX_W, MAX_H), (0, 0, 0, 0)) if LCD4linux.WetterTransparenz.value == "crop": @@ -11058,12 +10989,12 @@ def putWetter(workaround, draw, im): Day = curr.get("Day", "") Icon = curr.get("Icon", "0") Cond = curr.get("Cond", "") - Regen = curr.get("Regen", "0") or "0" + Regen = curr.get("Regen", "0") if "." in Regen: Regen += "mm" if LCD4linux.WetterRain.value == "true2" else "" else: Regen += "%" if LCD4linux.WetterRain.value == "true2" else "" - if ConfigType[0] == "5": + if ConfigType.startswith("5"): font = ImageFont.truetype(ConfigFont, int(14 * Wmulti), encoding='unic') fontD = ImageFont.truetype(ConfigFont, int(14 * Wmulti), encoding='unic') else: @@ -11081,17 +11012,14 @@ def putWetter(workaround, draw, im): pil_image = pil_image.resize((int(int(LCD4linux.WetterIconZoom.value) * Wmulti), y)) else: pil_image = pil_image.resize((int(int(LCD4linux.WetterIconZoom.value) * Wmulti), y), Image.LANCZOS if PY3 else Image.ANTIALIAS) - if ConfigType[0] == "5": - PY = POSY - int(20 * Wmulti) - else: - PY = int(POSY + (int(40 * Wmulti) - y) / 2) + PY = POSY - int(20 * Wmulti) if ConfigType.startswith("5") else int(POSY + (int(40 * Wmulti) - y) / 2) PX = POSX + int((27 * Wmulti) - int(int(LCD4linux.WetterIconZoom.value) * Wmulti) / 2) self.im[Wim].paste(pil_image, (PX, PY + int(20 * Wmulti))) - if ConfigType[0] == "5": - Dayw, h = getFsize(Day, fontD) + if ConfigType.startswith("5"): if LCD4linux.WetterLine.value.startswith("true"): self.draw[Wim].line((10, POSY, MAX_W - 10, POSY), fill=ConfigColor) - PX = int(POSX - Dayw - (3 * Wmulti)) + w, h = getFsize(Day, fontD) + PX = int(POSX - w - (3 * Wmulti)) ShadowText(Wim, PX, POSY, Day, fontD, ConfigColor, ConfigShadow) w, h = getFsize("%s°" % High, font) PX = int(POSX - w - (3 * Wmulti)) @@ -11142,7 +11070,7 @@ def putWetter(workaround, draw, im): self.draw[Wim].line((POSX, 1, POSX, POSY + int(60 * Wmulti)), fill=ConfigColor) elif LCD4linux.WetterLine.value == "trueLong": self.draw[Wim].line((POSX, 1, POSX, POSY + int(80 * Wmulti)), fill=ConfigColor) - if ConfigType[0] == "5": + if ConfigType.startswith("5"): POSX = int(54 * 2 * Wmulti) POSY += int(54 * Wmulti) else: @@ -11153,7 +11081,7 @@ def putWetter(workaround, draw, im): elif LCD4linux.WetterLine.value == "trueLong": self.draw[Wim].line((POSX, 1, POSX, POSY + int(80 * Wmulti)), fill=ConfigColor) POSX += 1 - if ConfigType[0] == "2": + if ConfigType.startswith("2"): POSX = 1 POSY += int(80 * Wmulti) Hum = "?" @@ -11165,14 +11093,14 @@ def putWetter(workaround, draw, im): Wtime = "" if ConfigType == "3": POSY = int(-19 * Wmulti) - elif ConfigType[0] == "5": + elif ConfigType.startswith("5"): POSX, POSY = (int(54 * Wmulti), 1) if len(self.WDay[ConfigWWW]) != 0 and LCD4linux.WetterExtra.value == True: Locname = self.WDay[ConfigWWW].get("Locname", "") if len(self.WDay[ConfigWWW]) != 0: Temp_c = self.WDay[ConfigWWW].get("Temp_c", "0") cleanTemp_c = Temp_c - Hum = self.WDay[ConfigWWW].get("Hum", "0") + Hum = self.WDay[ConfigWWW].get("Hum", "0%") cleanHum = Hum.replace("%", "").strip() Feel = self.WDay[ConfigWWW].get("Feel", "0") cleanFeel = Feel @@ -11185,26 +11113,20 @@ def putWetter(workaround, draw, im): if Feel == "" or abs(int(round(float(Feel), 0) or "0") - int(round(float(Temp_c), 0) or "0")) < int(LCD4linux.WetterExtraFeel.value) or LCD4linux.WetterExtra.value == False: Feel = "" else: - Feelarrow = "" - if LCD4linux.WetterTrendArrows.value: - if OldFeel != -88: - Feelarrow = "▲" if OldFeel < float(Feel) else "▼" - else: - Feelarrow = "●" - OldFeel = float(cleanFeel) - Feel = "%s%s°" % (Feelarrow, Feel) - Temparrow = "" - if LCD4linux.WetterTrendArrows.value: - if OldTemp_c != -88: - Temparrow = "▲" if OldTemp_c < float(Temp_c) else "▼" - else: - Temparrow = "●" - OldTemp_c = float(cleanTemp_c) - Temp_c = "%s%s°" % (Temparrow, Temp_c) - if ConfigType[0] == "4": + if trendarrows: + Feelarrow = "●" if OldFeel == -88 else "▲" if OldFeel < float(Feel) else "▼" + OldFeel = float(cleanFeel) + Feel = "%s%s" % (Feelarrow, Feel) + Feel += "°" + if trendarrows: + Temparrow = "●" if OldTemp_c == -88 else "▲" if OldTemp_c < float(Temp_c) else "▼" + OldTemp_c = float(cleanTemp_c) + Temp_c = "%s%s" % (Temparrow, Temp_c) + Temp_c += "°" + if ConfigType.startswith("4"): if ConfigType == "4": Temp_c += "C" - TextSize = int((20 if LCD4linux.WetterTrendArrows.value else 25) * Wmulti) + TextSize = int(25 * Wmulti) font = ImageFont.truetype(ConfigFont, TextSize, encoding='unic') w, h = getFsize(Temp_c, font) while w > MAX_W: @@ -11217,89 +11139,91 @@ def putWetter(workaround, draw, im): if isfile(join(UseWetterPath, Icon)): pil_image = Image.open(join(UseWetterPath, Icon)).convert(imageMode) xx, yy = pil_image.size - if ConfigType[0] == "5": - y = int(float((int(LCD4linux.WetterIconZoom.value) + 30) * Wmulti) / xx * yy) + if ConfigType.startswith("5"): + y = int((int(LCD4linux.WetterIconZoom.value) + 5) * Wmulti / xx * yy) + x = int((int(LCD4linux.WetterIconZoom.value) + 5) * Wmulti) if str(LCD4linux.BilderQuality.value) == "0": - pil_image = pil_image.resize((int((int(LCD4linux.WetterIconZoom.value) + 30) * Wmulti), y)) + pil_image = pil_image.resize((x, y)) else: - pil_image = pil_image.resize((int((int(LCD4linux.WetterIconZoom.value) + 30) * Wmulti), y), Image.LANCZOS if PY3 else Image.ANTIALIAS) + pil_image = pil_image.resize((x, y), Image.LANCZOS if PY3 else Image.ANTIALIAS) xx, yy = pil_image.size - PY = 1 - int(20 * Wmulti) - POSX = MAX_W - xx + PY = 1 - int(10 * Wmulti) else: - y = int(float(int(LCD4linux.WetterIconZoom.value) * Wmulti) / xx * yy) + y = int((int(LCD4linux.WetterIconZoom.value) * Wmulti) / xx * yy) + x = int(int(LCD4linux.WetterIconZoom.value) * Wmulti) if str(LCD4linux.BilderQuality.value) == "0": - pil_image = pil_image.resize((int(int(LCD4linux.WetterIconZoom.value) * Wmulti) + 2, y)) + pil_image = pil_image.resize((x, y)) else: - pil_image = pil_image.resize((int(int(LCD4linux.WetterIconZoom.value) * Wmulti) + 2, y), Image.LANCZOS if PY3 else Image.ANTIALIAS) - PY = int(POSY + (int(40 * Wmulti) - y) / 2) - self.im[Wim].paste(pil_image, (POSX, PY + int(20 * Wmulti))) - POSXs, POSYs = (POSX, POSY + int(79 * Wmulti)) if ConfigType == "3" else (POSX, POSY) + pil_image = pil_image.resize((x, y), Image.LANCZOS if PY3 else Image.ANTIALIAS) + PY = int(POSY + (int(34 * Wmulti) - y) / 2) + self.im[Wim].paste(pil_image, (POSX, PY + int(20 * Wmulti))) + POSYs = POSY + {"2": 79, "1": 67}.get(LCD4linux.WetterWindLines.value, 56) * Wmulti if ConfigType.startswith("3") else POSY minus5 = -3 font = ImageFont.truetype(ConfigFont, int(((int(LCD4linux.WetterExtraZoom.value) - 100) / 20.0 + 8) * Wmulti), encoding='unic') - ShadowText(Wim, POSXs - minus5, POSYs, "%s %s" % (Locname, Wtime), font, LCD4linux.WetterExtraColorCity.value, ConfigShadow) - HumColor = LCD4linux.WetterRainColor.value if float(cleanHum) < int(LCD4linux.WetterRainColor2use.value) else LCD4linux.WetterRainColor2.value - Humarrow = "" - if LCD4linux.WetterTrendArrows.value: - if OldHum != -88: - Humarrow = "▲" if OldHum < float(cleanHum) else "▼" - else: - Humarrow = "●" - OldHum = float(cleanHum) - Hum = "%s%s" % (Humarrow, Hum) - Windarrow = "" - if LCD4linux.WetterTrendArrows.value: - if OldWind != -88: - Windarrow = "▲" if OldWind < float(cleanWind[0]) else "▼" - else: - Windarrow = "●" - OldWind = float(cleanWind[0]) - Wind = "%s%s" % (Windarrow, Wind) - if ConfigType[0] == "5": - font = ImageFont.truetype(ConfigFont, int(15 * Wmulti), encoding='unic') - w, h = getFsize(Cond, font) - PX = max(MAX_W - w - int(3 * Wmulti), 0) - ShadowText(Wim, PX, int(70 * Wmulti), Cond, font, ConfigColor, ConfigShadow) - w, h = getFsize(Wind, font) - ShadowText(Wim, MAX_W - w - int(3 * Wmulti), int(70 * Wmulti) + h, Wind, font, ConfigColor, ConfigShadow) - font = ImageFont.truetype(ConfigFont, int(35 * Wmulti), encoding='unic') - w, h = getFsize(Temp_c, font) + ShadowText(Wim, POSX - minus5, POSYs, "%s %s" % (Locname, Wtime), font, LCD4linux.WetterExtraColorCity.value, ConfigShadow) + if trendarrows: + Humarrow = "●" if OldHum == -88 else "▲" if OldHum < float(cleanHum) else "▼" + OldHum = float(cleanHum) + Hum = "%s%s" % (Humarrow, Hum) + if trendarrows: + Windarrow = "●" if OldWind == -88 else "▲" if OldWind < float(cleanWind[0]) else "▼" + OldWind = float(cleanWind[0]) + Wind = "%s%s" % (Windarrow, Wind) + + font = ImageFont.truetype(ConfigFont, int(13 * Wmulti), encoding='unic') + if LCD4linux.WetterWindLines.value == "2": + Wind = (Wind.split(" ", 2)) + for i in range(len(Wind), 3): + Wind.append("na") + ShadowText(Wim, POSX - minus5, POSY + int(56 * Wmulti), "%s %s" % (Wind[0], Wind[1]), font, ConfigColor, ConfigShadow) + ShadowText(Wim, POSX - minus5, POSY + int(67 * Wmulti), Wind[2], font, ConfigColor, ConfigShadow) + elif LCD4linux.WetterWindLines.value != "off": + ShadowText(Wim, POSX - minus5, POSY + int(56 * Wmulti), Wind, font, ConfigColor, ConfigShadow) + font = ImageFont.truetype(ConfigFont, int((24 if largesize else 20) * Wmulti), encoding='unic') + w, h = getFsize(Temp_c, font) + if not PY3: # for equal results, w needs an correction under Python 2 + w = int(w * (0.57 if trendarrows else 0.66)) + PX = MAX_Wc - int(w) + PY = POSY + int((8 if largesize else 16) * Wmulti) + ShadowText(Wim, PX, PY, Temp_c, font, LCD4linux.WetterHighColor.value, ConfigShadow) + + if LCD4linux.WetterRain.value != "false" and LCD4linux.WetterExtra.value: + if not ConfigType.startswith("4") and len(self.WWeek[ConfigWWW]) > 0: + Regen = self.WWeek[ConfigWWW][0].get("Regen", "0") + RColor = LCD4linux.WetterRainColor.value + if "." in Regen: + if float(Regen) * 10 >= int(LCD4linux.WetterRainColor2use.value): + RColor = LCD4linux.WetterRainColor2.value + Regen += "mm" if LCD4linux.WetterRain.value == "true2" else "" + else: + if int(Regen) >= int(LCD4linux.WetterRainColor2use.value): + RColor = LCD4linux.WetterRainColor2.value + Regen += "%" if LCD4linux.WetterRain.value == "true2" else "" + if float(Regen.replace("m", "").replace("%", "")) > 0: + font = ImageFont.truetype(ConfigFont, int(12 * Wmulti), encoding='unic') + PX = MAX_Wc - int(int(44 if trendarrows else 32) * Wmulti) - (0 if ConfigType.startswith("3") else int(8 * Wmulti)) + PY = POSY + int((34 if ConfigType.startswith("3") else 31) * Wmulti) + ShadowText(Wim, PX, PY, Regen, font, RColor, ConfigShadow) + + font = ImageFont.truetype(ConfigFont, int((15 if largesize else 12) * Wmulti), encoding='unic') + w, h = getFsize(Feel, font) if not PY3: # for equal results, w needs an correction under Python 2 - w = int(w * 0.65) - ShadowText(Wim, POSX - w - int(3 * Wmulti), POSY, Temp_c, font, LCD4linux.WetterHighColor.value, ConfigShadow) - w, h = getFsize(Temp_c[-1:], font) - font = ImageFont.truetype(ConfigFont, int((int(LCD4linux.WetterExtraZoom.value) / (8 if LCD4linux.WetterTrendArrows.value else 10) + 4) * Wmulti), encoding='unic') - wF, hF = getFsize(Feel, font) - ShadowText(Wim, POSX - w - int(3 * Wmulti), POSY + h - int(hF * 0.8), Feel, font, LCD4linux.WetterExtraColorFeel.value, ConfigShadow) - font = ImageFont.truetype(ConfigFont, int(15 * Wmulti), encoding='unic') - wH, hH = getFsize(Hum, font) - ShadowText(Wim, POSX - wH - int(3 * Wmulti), POSY + h + int(hF / 2), Hum, font, ConfigColor, ConfigShadow) - else: - font = ImageFont.truetype(ConfigFont, int(13 * Wmulti), encoding='unic') - if LCD4linux.WetterWindLines.value == "2": - Wind = (Wind.split(" ", 2)) - for i in range(len(Wind), 3): - Wind.append("na") - ShadowText(Wim, POSX - minus5, POSY + int(56 * Wmulti), "%s %s" % (Wind[0], Wind[1]), font, ConfigColor, ConfigShadow) - ShadowText(Wim, POSX - minus5, POSY + int(67 * Wmulti), Wind[2], font, ConfigColor, ConfigShadow) - elif LCD4linux.WetterWindLines.value != "off": - ShadowText(Wim, POSX - minus5, POSY + int(62 * Wmulti), Wind, font, ConfigColor, ConfigShadow) - font = ImageFont.truetype(ConfigFont, int((20 if LCD4linux.WetterTrendArrows.value else 25) * Wmulti), encoding='unic') - w, h = getFsize(Temp_c, font) - TempPosX = POSX + int(45 * Wmulti) - TempPosY = POSY + int((10 if LCD4linux.WetterWindLines.value == "2" and ConfigType[0] != "3" else 16) * Wmulti) - ShadowText(Wim, TempPosX, TempPosY, Temp_c, font, LCD4linux.WetterHighColor.value, ConfigShadow) - font = ImageFont.truetype(ConfigFont, int((14 if LCD4linux.WetterTrendArrows.value else 16) * Wmulti), encoding='unic') - wH, hH = getFsize(Hum, font) - HumPosY = POSY + int((12 if LCD4linux.WetterWindLines.value == "2" and ConfigType[0] != "3" else 20) * Wmulti) + h - ShadowText(Wim, TempPosX, HumPosY, Hum, font, HumColor, ConfigShadow) - if not PY3: # for equal results, wH needs an correction under Python 2 - wH = int(wH * 0.8) - font = ImageFont.truetype(ConfigFont, int(int(LCD4linux.WetterExtraZoom.value) / (16.0 if LCD4linux.WetterTrendArrows.value else 13.0) * Wmulti), encoding='unic') - ShadowText(Wim, TempPosX + int(wH * 0.8), HumPosY - int(hH * (0.57 if ConfigType[0] == "3" else 0.5)), Feel, font, LCD4linux.WetterExtraColorFeel.value, ConfigShadow) - PICwetter[ConfigWWW] = False + w = int(w * (0.58 if trendarrows else 0.67)) + PX = MAX_Wc - int(w) + PY = POSY + int((28 if largesize else 34) * Wmulti) + ShadowText(Wim, PX, PY, Feel, font, LCD4linux.WetterExtraColorFeel.value, ConfigShadow) + + font = ImageFont.truetype(ConfigFont, int((18 if largesize else 14) * Wmulti), encoding='unic') + w, h = getFsize(Hum, font) + if not PY3: # for equal results, w needs an correction under Python 2 + w = int(w * (0.72 if trendarrows else 0.98)) if largesize else int(w * (0.72 if trendarrows else 0.98)) + PX = MAX_Wc - int(w) + PY = POSY + int((40 if largesize else 44) * Wmulti) + ShadowText(Wim, PX, PY, Hum, font, LCD4linux.WetterHumColor.value, ConfigShadow) + + PICwetter[ConfigWWW] = 1 counter = 20 - while PICwetter[ConfigWWW] is True and counter > 0: + while PICwetter[ConfigWWW] == "wait" and counter > 0: L4logE("Weatherwait") sleep(0.03) counter -= 1 @@ -11441,25 +11365,17 @@ def putMoon(workaround, draw, im): INFOS = "" if ConfigInfo[2] == "1": MoonDist = MoonDistance() - MoonDistarrow = "" if ConfigTrends: - if OldMoonDist != -88: - MoonDistarrow = "▲" if OldMoonDist < MoonDist else "▼" - else: - MoonDistarrow = "●" - OldMoonDist = MoonDist - INFOS += "%s%s km" % (MoonDistarrow, round(MoonDist)) + MoonDistarrow = "●" if OldMoonDist == -88 else "▲" if OldMoonDist < MoonDist else "▼" + OldMoonDist = MoonDist + INFOS += "%s%s km" % (MoonDistarrow, round(MoonDist)) if ConfigInfo[1] == "1": illum = 100 - abs((cos(pi * POS) + 0j) ** 1.7 * 100) illum = abs(illum - 1) / .99 if illum - 1 > 0 else 0.0 - illumarrow = "" if ConfigTrends: - if Oldillum != -88: - illumarrow = "▲" if float(Oldillum) < illum else "▼" - else: - illumarrow = "●" - Oldillum = illum - INFOS += "- %s%s %%" % (illumarrow, round(illum, 1)) + illumarrow = "●" if Oldillum in [-88, 0] else "▲" if float(Oldillum) < illum else "▼" + Oldillum = illum + INFOS += "- %s%s %%" % (illumarrow, round(illum, 1)) if INFOS != "": w, h = getFsize(Code_utf8(INFOS), font) if w > ConfigSize: @@ -11599,7 +11515,7 @@ def putClock(workaround, draw, im): if ConfigSplit == True: MAX_W = int(MAX_W / 2) pp = ConfigPos - if ConfigType[0] == "4": + if ConfigType.startswith("4"): y = int(ConfigSize * 1.8) y271 = int(y / 2.71) if isfile(ClockBack) == True: @@ -11638,7 +11554,7 @@ def putClock(workaround, draw, im): ShadowText(draw, POSX + lx, ConfigPos + int((y / 1.14) - (h / 2)), now, font, ConfigColor, ConfigShadow) except Exception: pass - elif ConfigType[0] == "5": + elif ConfigType[0].startswith("5"): y = int(ConfigSize * 1.8) POSX = getSplit(ConfigSplit, ConfigAlign, MAX_W, y) pil_image = Clock + str(ConfigAnalog) + "/Clock.png" @@ -11712,7 +11628,7 @@ def putClock(workaround, draw, im): ShadowText(draw, x1, y1, now, font, ConfigColor, ConfigShadow) except Exception: pass - elif ConfigType[0] == "1": + elif ConfigType.startswith("1"): now = "" font = ImageFont.truetype(ConfigFont, ConfigSize, encoding='unic') ww, hS = getFsize(strftime("%H:%M"), font) @@ -11733,7 +11649,6 @@ def putClock(workaround, draw, im): elif tt == "3": font = ImageFont.truetype(ConfigFont, int(ConfigSize / 2.5), encoding='unic') now = Code_utf8(_(strftime("%A"))) - w, h = getFsize(now, font) lx = getSplit(ConfigSplit, ConfigAlign, MAX_W, w) if (ll + w / 2) < MAX_W and (ll - w / 2) > 0: @@ -12331,11 +12246,11 @@ def putProgress(workaround, draw, im): elif ConfigType[0] in ["3", "5", "7"]: remaining = "%d%s" % (int(position[1] * 100 / length[1]), Prozent) w, h = getFsize(remaining, font) - if ConfigType[0] == "3": + if ConfigType.startswith("3"): ProgressBar -= (w + 10) Minus = 0 MinusProgress = 0 - elif ConfigType[0] == "7": + elif ConfigType.startswith("7"): Minus = -(ConfigSize - 2 + int((h - ConfigSize) / 2)) MinusProgress = (w + 10) else: @@ -12413,11 +12328,11 @@ def putProgress(workaround, draw, im): elif ConfigType[0] in ["3", "5", "7"]: remaining = "%d%s" % (int(event_run * 100 / duration), Prozent) w, h = getFsize(remaining, font) - if ConfigType[0] == "3": + if ConfigType.startswith("3"): ProgressBar -= (w + 10) Minus = 0 MinusProgress = 0 - elif ConfigType[0] == "7": + elif ConfigType.startswith("7"): Minus = -(ConfigSize - 2 + int((h - ConfigSize) / 2)) MinusProgress = (w + 10) else: @@ -12646,7 +12561,7 @@ def putSat(workaround, draw, im): font = ImageFont.truetype(ConfigFont, ConfigSize, encoding='unic') w, h = getFsize(Code_utf8(orbital), font) piconfile = join(LCD4linux.SatPath.value, "%s.png" % str(orbital).replace(".", "")) - if ConfigType[0] == "2" and isfile(piconfile): + if ConfigType.startswith("2") and isfile(piconfile): try: imW = Image.open(piconfile) xx, yy = imW.size @@ -12801,15 +12716,15 @@ def putDescription(workaround, draw, im): event_name = "" if self.LEventsDesc is not None and len(self.LEventsDesc) > 0: if self.LEventsDesc[0][4]: - if self.LEventsDesc[0][5] != "" and (ConfigType[0] == "1" or (ConfigType[0] == "2" and self.LEventsDesc[0][6] == "")): + if self.LEventsDesc[0][5] != "" and (ConfigType[0] in ["1", "2"] and self.LEventsDesc[0][6] == ""): event_name += self.LEventsDesc[0][5] + "\n" - if self.LEventsDesc[0][6] != "" and (ConfigType[1] == "1" or (ConfigType[1] == "2" and self.LEventsDesc[0][5] == "")): + if self.LEventsDesc[0][6] != "" and (ConfigType[1] in ["1", "2"] and self.LEventsDesc[0][5] == ""): event_name += self.LEventsDesc[0][6] if event_name == "": if self.LShortDescription is not None and self.LExtendedDescription is not None: - if self.LShortDescription != "" and (ConfigType[0] == "1" or (ConfigType[0] == "2" and self.LExtendedDescription == "")): + if self.LShortDescription != "" and (ConfigType[0] in ["1", "2"] and self.LExtendedDescription == ""): event_name += self.LShortDescription + "\n" - if self.LExtendedDescription != "" and (ConfigType[1] == "1" or (ConfigType[1] == "2" and self.LShortDescription == "")): + if self.LExtendedDescription != "" and (ConfigType[1] in ["1", "2"] and self.LShortDescription == ""): event_name += self.LExtendedDescription if self.LsreftoString is not None and event_name == "": sreffile = self.LsrefFile @@ -14073,7 +13988,7 @@ def putNetatmoIllu(workaround, draw, im): staerkeValOrg = staerkeVal2 staerke = staerkeVal2 dis_reason = Code_utf8(self.dis_reason[ConfigStation]) - if ConfigType[0] == "0": + if ConfigType.startswith("0"): if ConfigType[1:] == "9": S = 1.5 if ConfigSize <= 10 else 1.0 ZW = str(staerkeValOrg) # Value @@ -14090,7 +14005,7 @@ def putNetatmoIllu(workaround, draw, im): except Exception: pass self.draw[draw].rectangle((POSX, ConfigPos, POSX + ConfigLen, ConfigPos + ConfigSize), outline="yellow") - elif ConfigType[0] == "1": + elif ConfigType.startswith("1"): if isfile(join(LCD4data, "pointmask.png")): try: imM = Image.open(join(LCD4data, "pointmask.png")) @@ -14126,27 +14041,24 @@ def putCalendar(workaround, draw, im): if ConfigSplit == True: MAX_Wi = int(MAX_Wi / 2) if PICcal is not None and [ConfigType, ConfigTypeE, LCD4linux.CalDays.value] == CalType and ConfigZoom == CalZoom and [ConfigColor, ConfigBackColor, ConfigCaptionColor] == CalColor: - try: - x, y = self.im[4].size - POSX = getSplit(ConfigSplit, ConfigAlign, MAX_Wi, x) - if LCD4linux.CalTransparenz.value == "true": - self.im[im].paste(self.im[4], (POSX, ConfigPos), self.im[4]) - else: - self.im[im].paste(self.im[4], (POSX, ConfigPos)) - except Exception: - pass + x, y = self.im[4].size + POSX = getSplit(ConfigSplit, ConfigAlign, MAX_Wi, x) + if LCD4linux.CalTransparenz.value == "true": + self.im[im].paste(self.im[4], (POSX, ConfigPos), self.im[4]) + else: + self.im[im].paste(self.im[4], (POSX, ConfigPos)) else: POSX = 0 POSY = 0 ConfigSize = int(20 * ConfigZoom / 10) MAX_H = ConfigSize MAX_W = ConfigSize * 16 - if ConfigType[0] == "0": + if ConfigType.startswith("0"): MAX_H = ConfigSize * 9 - elif ConfigType[0] == "1": + elif ConfigType.startswith("1"): MAX_H = ConfigSize * 4 if ConfigTypeE[0] in ["C", "D"]: - if ConfigType[0] == "9": + if ConfigType.startswith("9"): MAX_W = ConfigSize * 25 MAX_H += ConfigSize * int(int(ConfigTypeE[1]) * 0.8) MAX_H += int(ConfigSize * 0.4) @@ -14184,7 +14096,7 @@ def putCalendar(workaround, draw, im): dd = 1 if day[0] == 0 else day[0] Week = date(datetime.now().year, datetime.now().month, dd).isocalendar()[1] PutWeek = False - if ConfigType[0] == "0" or (ConfigType[0] == "1" and ThisWeek == Week): + if ConfigType.startswith("0") or (ConfigType.startswith("1") and ThisWeek == Week): PutWeek = True Week = str(Week) w, h = getFsize(Week, font) @@ -14374,7 +14286,7 @@ def putRecording(workaround, draw, im): MAX_W, MAX_H = self.im[im].size POSX = None if self.LisRecording or ConfigMode == True: - if ConfigType[0] == "1": + if ConfigType.startswith("1"): self.draw[draw].ellipse((MAX_W - ConfigSize, -ConfigSize, MAX_W + ConfigSize, ConfigSize), fill="red") else: try: @@ -14393,7 +14305,7 @@ def putRecording(workaround, draw, im): except Exception: L4log("Error Recording Pic") if self.LisTimeshift and "t" in ConfigType: - if ConfigType[0] == "1": + if ConfigType.startswith("1"): for i in range(-1, 3): self.draw[draw].ellipse((MAX_W - ConfigSize - i, -ConfigSize - i, MAX_W + ConfigSize + i, ConfigSize + i), outline="yellow") else: From 81127e8903d0b2d61e4ae3c3395e07b4b93daaca Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Mon, 18 Mar 2024 19:34:17 +0100 Subject: [PATCH 10/17] [LCD4linux] v5.0-r18: revert some display assignments --- lcd4linux/src/plugin.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 9ba84df..b3cd81c 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -2842,9 +2842,9 @@ def getResolution(t, r): if int(LCD4linux.xmlOffset.value) != 0: MAX_W -= (int(LCD4linux.xmlOffset.value) * 2) MAX_H -= (int(LCD4linux.xmlOffset.value) * 2) - elif t.endswith("1"): + elif t[1:] == "1": MAX_W, MAX_H = 320, 240 - elif t.endswith("2"): + elif t[1:] == "2": MAX_W, MAX_H = 240, 320 elif t[1:] in ["3", "4", "5", "10", "15"]: MAX_W, MAX_H = 800, 480 @@ -2852,21 +2852,21 @@ def getResolution(t, r): MAX_W, MAX_H = 800, 600 elif t[1:] in ["7", "8", "13", "14"]: MAX_W, MAX_H = 1024, 600 - elif t.endswith("17"): + elif t[1:] == "17": MAX_W, MAX_H = 220, 176 - elif t.endswith("18"): + elif t[1:] == "18": MAX_W, MAX_H = 255, 64 - elif t.endswith("22"): + elif t[1:] == "22": MAX_W, MAX_H = 480, 320 - elif t.endswith("23"): + elif t[1:] == "23": MAX_W, MAX_H = 800, 480 - elif t.endswith("30"): + elif t[1:] == "30": MAX_W, MAX_H = 400, 240 elif t == "320": MAX_W, MAX_H = LCD4linux.SizeW.value, LCD4linux.SizeH.value elif t == "420": MAX_W, MAX_H = LCD4linux.SizeW2.value, LCD4linux.SizeH2.value - elif t.endswith("21"): + elif t[1:] == "21": MAX_W, MAX_H = 128, 128 else: MAX_W, MAX_H = 132, 64 From 927d3414a57b8b1612cc3ba930ddb6697ab7e0a2 Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Thu, 28 Mar 2024 00:43:03 +0100 Subject: [PATCH 11/17] [LCD4linux] v5.0-r18 revert function "extended describtion' --- lcd4linux/src/plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index b3cd81c..295dbed 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -12716,15 +12716,15 @@ def putDescription(workaround, draw, im): event_name = "" if self.LEventsDesc is not None and len(self.LEventsDesc) > 0: if self.LEventsDesc[0][4]: - if self.LEventsDesc[0][5] != "" and (ConfigType[0] in ["1", "2"] and self.LEventsDesc[0][6] == ""): + if self.LEventsDesc[0][5] != "" and (ConfigType[0] == "1" or (ConfigType[0] == "2" and self.LEventsDesc[0][6] == "")): event_name += self.LEventsDesc[0][5] + "\n" - if self.LEventsDesc[0][6] != "" and (ConfigType[1] in ["1", "2"] and self.LEventsDesc[0][5] == ""): + if self.LEventsDesc[0][6] != "" and (ConfigType[1] == "1" or (ConfigType[1] == "2" and self.LEventsDesc[0][5] == "")): event_name += self.LEventsDesc[0][6] if event_name == "": if self.LShortDescription is not None and self.LExtendedDescription is not None: - if self.LShortDescription != "" and (ConfigType[0] in ["1", "2"] and self.LExtendedDescription == ""): + if self.LShortDescription != "" and (ConfigType[0] == "1" or (ConfigType[0] == "2" and self.LExtendedDescription == "")): event_name += self.LShortDescription + "\n" - if self.LExtendedDescription != "" and (ConfigType[1] in ["1", "2"] and self.LShortDescription == ""): + if self.LExtendedDescription != "" and (ConfigType[1] == "1" or (ConfigType[1] == "2" and self.LShortDescription == "")): event_name += self.LExtendedDescription if self.LsreftoString is not None and event_name == "": sreffile = self.LsrefFile From 0b3110698eb4601cd4567984354b3453101c8978 Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Thu, 4 Apr 2024 23:38:46 +0200 Subject: [PATCH 12/17] [LCD4linux] update v5.0-r19 - reverted code for internal box displays skins --- lcd4linux/src/plugin.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 295dbed..7660006 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -172,7 +172,7 @@ if find_library("usb-0.1") is not None or find_library("usb-1.0") is not None: print("[LCD4linux] libusb found :-)", getEnigmaVersionString()) USBok = True -Version = "V5.0-r18" +Version = "V5.0-r19" L4LElist = L4Lelement() L4LdoThread = True LCD4enigma2config = resolveFilename(SCOPE_CONFIG) # /etc/enigma2/ @@ -4182,8 +4182,19 @@ def xmlRead(): while len(xmlList[-1]) < 2 and len(xmlList) > 1: del xmlList[-1] else: - xmlList = ["", ""] - + sli = xmlReadData() + aw, ah = 0, 0 + ttt = [0] + for i in sli[0]: + ttt = LCD4linux.xmlLCDType.value.split("x") + aw, ah = 0, 0 + if LCD4linux.xmlLCDType.value == "96x64": + i = i.replace("\">", "\" id=\"2\">") + if getFB2(False): + if "PixmapLcd4linux" in i: + i = i.replace("0,0", "10,13") + aw, ah = 10, 171 + xmlList = ["\n".join(sli[0]).replace("$w$", str(int(ttt[0]) + aw)).replace("$h$", str(int(ttt[1]) + ah)), ""] def xmlReadData(): sld = [[], [], [], []] From 393e396ea2ae6a5e11d2c139bb3da122b779b3dd Mon Sep 17 00:00:00 2001 From: oe-alliance-plugins python bot Date: Thu, 4 Apr 2024 21:43:57 +0000 Subject: [PATCH 13/17] PEP8 double aggressive E301 ~ E306 --- lcd4linux/src/plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 7660006..839eccf 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -4196,6 +4196,7 @@ def xmlRead(): aw, ah = 10, 171 xmlList = ["\n".join(sli[0]).replace("$w$", str(int(ttt[0]) + aw)).replace("$h$", str(int(ttt[1]) + ah)), ""] + def xmlReadData(): sld = [[], [], [], []] if isfile(join(LCD4data, "skin_data.xml")): From b8d7bcd29be972d666965348bd8f107edaa2599d Mon Sep 17 00:00:00 2001 From: Hains van den Bosch Date: Sun, 11 Aug 2024 09:43:22 +0200 Subject: [PATCH 14/17] [LCD4linux] v5.0-r21 new global switch 'Show Streams in Mode Media/On' Based on: https://github.com/oe-alliance/oe-alliance-plugins/commit/96b2e8edc7c77010c80b6a693fb6bdb6bbbe45fa --- lcd4linux/src/configOptions.py | 1 + lcd4linux/src/plugin.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lcd4linux/src/configOptions.py b/lcd4linux/src/configOptions.py index bcfd19d..1e3d90d 100644 --- a/lcd4linux/src/configOptions.py +++ b/lcd4linux/src/configOptions.py @@ -189,6 +189,7 @@ ['self.list1', 'MJPEG Cycle', ' LCD4linux.MJPEGCycle', 14], ['self.list1', 'MJPEG Restart on Error', ' LCD4linux.MJPEGRestart', 14], ['self.list1', 'MJPEG Header Mode', ' LCD4linux.MJPEGHeader', 14], + ['self.list1', 'Show Streams '4097; 5001...5003' in Mode', ' LCD4linux.Streaming', 0], ['self.list1', 'Sonos IP', ' LCD4linux.SonosIP', 19], ['self.list1', 'Sonos Ping Timeout [ms]', ' LCD4linux.SonosPingTimeout', 19], ['self.list1', 'Sonos Play Check', ' LCD4linux.SonosCheckTimer', 19], diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 839eccf..2c17820 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -172,7 +172,7 @@ if find_library("usb-0.1") is not None or find_library("usb-1.0") is not None: print("[LCD4linux] libusb found :-)", getEnigmaVersionString()) USBok = True -Version = "V5.0-r19" +Version = "V5.0-r21" L4LElist = L4Lelement() L4LdoThread = True LCD4enigma2config = resolveFilename(SCOPE_CONFIG) # /etc/enigma2/ @@ -429,6 +429,7 @@ LCD4linux.MJPEGHeader = ConfigSelection(choices=[("0", _("normal")), ("1", _("reduced"))], default="1") LCD4linux.MJPEGCycle = ConfigSelectionNumber(1, 10, 1, default=2) LCD4linux.MJPEGRestart = ConfigYesNo(default=True) +LCD4linux.Streaming = ConfigSelection(choices=[("0", _("Media")), ("1", _("On"))], default="0") LCD4linux.WebIfRefresh = ConfigSelectionNumber(1, 60, 1, default=3) LCD4linux.WebIfType = ConfigSelection(choices=[("0", _("Javascript")), ("01", _("Javascript no Refresh")), ("1", _("Reload"))], default="0") LCD4linux.WebIfInitDelay = ConfigYesNo(default=False) @@ -5854,6 +5855,7 @@ def SetList(self): self.list1.append(getConfigListEntry(_("MJPEG Cycle"), LCD4linux.MJPEGCycle)) self.list1.append(getConfigListEntry(_("MJPEG Restart on Error"), LCD4linux.MJPEGRestart)) self.list1.append(getConfigListEntry(_("MJPEG Header Mode"), LCD4linux.MJPEGHeader)) + self.list1.append(getConfigListEntry(_("Show Streams '4097; 5001...5003' in Mode"), LCD4linux.Streaming)) self.list1.append(getConfigListEntry(_("Sonos IP"), LCD4linux.SonosIP)) self.list1.append(getConfigListEntry(_("Sonos Ping Timeout [ms]"), LCD4linux.SonosPingTimeout)) self.list1.append(getConfigListEntry(_("Sonos Play Check"), LCD4linux.SonosCheckTimer)) @@ -14481,6 +14483,7 @@ def Lput4(LCD, SCR, FUNC, PARA): elif sref.startswith(("4097:0", "5001:0", "5002:0", "5003:0")): if self.Lpath and self.Lpath.startswith("http") and self.Llength and self.Llength[0] == -1: L4log("detected IPTV") + isMediaPlayer = "mp3" if LCD4linux.Streaming.value == "0" else "" else: L4log("detected VOD Media") isMediaPlayer = "mp3" From 267b0a9274267f80f6fda30e57633a84145dc0ac Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Fri, 26 Jul 2024 14:18:12 +0200 Subject: [PATCH 15/17] [LCD4linux] v5.0-r22 bugfix: shows picon during IPTV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bugfix: zeigt Picons während dem IPTV-streamen und Cover während dem MP3-streamen (z.B. Internetradio) --- lcd4linux/src/plugin.py | 72 ++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 2c17820..ae3a39f 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -172,7 +172,7 @@ if find_library("usb-0.1") is not None or find_library("usb-1.0") is not None: print("[LCD4linux] libusb found :-)", getEnigmaVersionString()) USBok = True -Version = "V5.0-r21" +Version = "V5.0-r22" L4LElist = L4Lelement() L4LdoThread = True LCD4enigma2config = resolveFilename(SCOPE_CONFIG) # /etc/enigma2/ @@ -2982,15 +2982,14 @@ def getpiconres(x, y, full, picon, channelname, channelname2, P2, P2A, P2C): if not PY3: name2 = "%s.png" % channelname.decode("utf-8").encode("latin-1", "ignore") name4 = "%s.png" % channelname.decode("utf-8").encode("utf-8", "ignore") - else: - name2 = "%s.png" % channelname - name4 = "%s.png" % channelname - name = normalize('NFKD', channelname) - name = sub(r'[^a-z0-9]', '', "%s.png" % str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) - if not PY3: name3 = "%s.png" % channelname2.replace('\xc2\x87', '').replace('\xc2\x86', '').decode("utf-8").encode("utf-8") + name = normalize('NFKD', unicode(str("" + channelname), 'utf-8', errors='ignore')).encode('ASCII', 'ignore') else: + name2 = "%s.png" % channelname.encode("latin-1", "ignore").decode("utf-8") + name4 = "%s.png" % channelname.encode("utf-8", "ignore").decode("utf-8") name3 = "%s.png" % channelname2.replace('\x87', '').replace('\x86', '') + name = normalize('NFKD', str("" + channelname)) + name = "%s.png" % sub(r'[^a-z0-9]', '', str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) PIC.append(join(P2, name3)) PIC.append(join(P2, name2)) PIC.append(join(P2, name)) @@ -9737,22 +9736,30 @@ def downloadWetter(self, ort, wetter): callInThread(getPage, self.feedurl, boundFunction(self.downloadOMcallback, wetter), self.downloadListError) elif LCD4linux.WetterApi.value == "OPENWEATHER": - apkey = "&appid=%s" % LCD4linux.WetterApiKeyOpenWeatherMap.value if len(LCD4linux.WetterApiKeyOpenWeatherMap.value) > 5 else "" - city = "id=%s" % quote(ort[3:]) if ort.startswith("wc:") else "q=%s" % quote(ort) - self.feedurl = "http://api.openweathermap.org/data/2.5/weather?%s&lang=%s&units=metric%s" % (city, la[:2], apkey) - L4logE("OWM-getcurrentweather%s: %s" % (wetter, self.feedurl)) - callInThread(getPage, self.feedurl, boundFunction(self.downloadOWMcallback, wetter), self.downloadListError) - self.feedurl = "https://api.openweathermap.org/data/2.5/onecall?&lon=%s&lat=%s&units=metric&exclude=hourly,minutely,current&lang=%s%s" % (self.Long[wetter], self.Lat[wetter], la[:2], apkey) - L4logE("OWM-getforecastweather%s: %s" % (wetter, self.feedurl)) - callInThread(getPage, self.feedurl, boundFunction(self.downloadOWMcallback, wetter), self.downloadListError) + if float(self.Long[wetter]) == 0 and float(self.Lat[wetter]) == 0: + self.feedurl = "https://geocoding-api.open-meteo.com/v1/search?language=%s&count=10&name=%s" % (la[:2], city) + L4logE("OWM-citysearch%s: %s" % (wetter, self.feedurl)) + callInThread(getPage, self.feedurl, boundFunction(self.getCityCoords, wetter), self.downloadListError) + else: + apkey = LCD4linux.WetterApiKeyOpenWeatherMap.value if len(LCD4linux.WetterApiKeyOpenWeatherMap.value) > 5 else "" + self.feedurl = "https://api.openweathermap.org/data/3.0/onecall?&lon=%s&lat=%s&units=metric&exclude=hourly,minutely,current&lang=%s&appid=%s" % (self.Long[wetter], self.Lat[wetter], la[:2], apkey) + L4logE("OWM-getOneCallWeather%s: %s" % (wetter, self.feedurl)) + callInThread(getPage, self.feedurl, boundFunction(self.downloadOWMcallback, wetter), self.downloadListError) elif LCD4linux.WetterApi.value == "WEATHERUNLOCKED": apkey = "?app_id=%s&app_key=%s" % (LCD4linux.WetterApiKeyWeatherUnlocked.value.split()[0], LCD4linux.WetterApiKeyWeatherUnlocked.value.split()[1]) if len(LCD4linux.WetterApiKeyWeatherUnlocked.value.split()) == 2 else "" lang = "&lang=%s" % ort.split(".")[0] if "." in ort else "" - self.feedurl = "http://api.weatherunlocked.com/api/current/%s%s%s" % (city, apkey, lang) + city = LCD4linux.WetterCity.value if wetter == 0 else LCD4linux.Wetter2City.value + if "." in city: # e.g. 'de.ZIPccode' + self.feedurl = "http://api.weatherunlocked.com/api/current/%s%s%s" % (city, apkey, lang) + else: + self.feedurl = "http://api.weatherunlocked.com/api/current/%s,%s%s%s" % (self.Long[wetter], self.Lat[wetter], apkey, lang) L4logE("WU-getcurrentweather%s: %s" % (wetter, self.feedurl)) callInThread(getPage, self.feedurl, boundFunction(self.downloadWUcallback, wetter), self.downloadListError) - self.feedurl = "http://api.weatherunlocked.com/api/forecast/%s%s%s" % (city, apkey, lang) + if "." in city: # e.g. 'de.ZIPcode' + self.feedurl = "http://api.weatherunlocked.com/api/forecast/%s%s%s" % (city, apkey, lang) + else: + self.feedurl = "http://api.weatherunlocked.com/api/forecast/%s,%s%s%s" % (self.Long[wetter], self.Lat[wetter], apkey, lang) L4logE("WU-getforecastweather%s: %s" % (wetter, self.feedurl)) callInThread(getPage, self.feedurl, boundFunction(self.downloadWUcallback, wetter), self.downloadListError) L4log("Wetter%s: downloadstart %s:%s %s %s" % (wetter, LCD4linux.WetterApi.value, ort, language.getLanguage(), la)) @@ -10823,16 +10830,17 @@ def getShowCover(BildFile): P2A = LCD4linux.PiconPathAlt.value PIC = [] PIC.append(join(P2, picon)) - name = normalize('NFKD', self.Lchannel_name) - name = sub(r'[^a-z0-9]', '', "%s.png" % str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) if not PY3: name2 = "%s.png" % self.Lchannel_name.decode("utf-8").encode("latin-1", "ignore") name4 = "%s.png" % self.Lchannel_name.decode("utf-8").encode("utf-8", "ignore") name3 = "%s.png" % self.Lchannel_name2.replace('\xc2\x87', '').replace('\xc2\x86', '').decode("utf-8").encode("utf-8") + name = normalize('NFKD', unicode(str("" + self.Lchannel_name), 'utf-8', errors='ignore')).encode('ASCII', 'ignore') else: - name2 = "%s.png" % self.Lchannel_name - name4 = "%s.png" % self.Lchannel_name + name2 = "%s.png" % self.Lchannel_name.encode("latin-1", "ignore").decode("utf-8") + name4 = "%s.png" % self.Lchannel_name.encode("utf-8", "ignore").decode("utf-8") name3 = "%s.png" % self.Lchannel_name2.replace('\x87', '').replace('\x86', '') + name = normalize('NFKD', str("" + self.Lchannel_name)) + name = "%s.png" % sub(r'[^a-z0-9]', '', str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) PIC.append(join(P2, name3)) PIC.append(join(P2, name2)) PIC.append(join(P2, name)) @@ -12033,16 +12041,17 @@ def putPicon(workaround, draw, im): useCache = False PIC = [] PIC.append(join(P2, picon)) - name = normalize('NFKD', self.Lchannel_name if PY3 else self.Lchannel_name.decode('unicode-escape')) - name = sub(r'[^a-z0-9]', '', "%s.png" % str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) if not PY3: name2 = "%s.png" % self.Lchannel_name.decode("utf-8").encode("latin-1", "ignore") name4 = "%s.png" % self.Lchannel_name.decode("utf-8").encode("latin-1", "ignore") name3 = "%s.png" % self.Lchannel_name2.replace('\xc2\x87', '').replace('\xc2\x86', '').decode("utf-8").encode("utf-8") + name = normalize('NFKD', self.Lchannel_name.decode('unicode-escape')) else: - name2 = "%s.png" % self.Lchannel_name - name4 = "%s.png" % self.Lchannel_name + name2 = "%s.png" % self.Lchannel_name.encode("latin-1", "ignore").decode("utf-8") + name4 = "%s.png" % self.Lchannel_name.encode("utf-8", "ignore").decode("utf-8") name3 = "%s.png" % self.Lchannel_name2.replace('\x87', '').replace('\x86', '') + name = normalize('NFKD', self.Lchannel_name) + name = "%s.png" % sub(r'[^a-z0-9]', '', str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) name5 = getPiconName(self.LsreftoString) PIC.append(join(P2, name3)) PIC.append(join(P2, name2)) @@ -12768,7 +12777,6 @@ def putTuner(workaround, draw, im): number = -1 if self.Ltuner_number is not None: number = self.Ltuner_number - i = "" Tcount = 0 font = ImageFont.truetype(ConfigFont, ConfigSize, encoding='unic') w, h = getFsize("A ", font) @@ -12797,10 +12805,7 @@ def putTuner(workaround, draw, im): for x in range(TunerCount): isON = True if TunerMask & count != 0: - if x == number: - c = LCD4linux.TunerColorActive.value - else: - c = LCD4linux.TunerColorOn.value + c = LCD4linux.TunerColorActive.value if x == number else LCD4linux.TunerColorOn.value else: c = LCD4linux.TunerColor.value isON = False @@ -12827,7 +12832,6 @@ def putInfo(workaround, draw, im): def NL(count): return "\n" if int(count) > 2 else "" - global CPUtotal global CPUidle MAX_W, MAX_H = self.im[im].size @@ -14438,7 +14442,7 @@ def Lput4(LCD, SCR, FUNC, PARA): if not LCD4linux.Enable.value: return tt = time() -# L4logE("MP-Mode",isMediaPlayer) +# L4logE("MP-Mode", isMediaPlayer) L4log("creating LCD-Picture: %s" % ScreenActive) if isdir("%slcd4linux" % TMP) == False: try: @@ -14482,8 +14486,8 @@ def Lput4(LCD, SCR, FUNC, PARA): self.CoverName = ["-", "-"] elif sref.startswith(("4097:0", "5001:0", "5002:0", "5003:0")): if self.Lpath and self.Lpath.startswith("http") and self.Llength and self.Llength[0] == -1: - L4log("detected IPTV") - isMediaPlayer = "mp3" if LCD4linux.Streaming.value == "0" else "" + L4log("detected AudioMedia or IPTV") + isMediaPlayer = "mp3" else: L4log("detected VOD Media") isMediaPlayer = "mp3" From 3416b8c479931f434b00631b5ab6f9bb44df34a8 Mon Sep 17 00:00:00 2001 From: jbleyel Date: Tue, 30 Jul 2024 11:36:41 +0200 Subject: [PATCH 16/17] [LCD4Linux] * partly revert https://github.com/oe-alliance/oe-alliance-plugins/commit/d4940247a485cfaebc72bc5b11112ed2313c498f --- lcd4linux/src/plugin.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index ae3a39f..34e75b7 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -2985,8 +2985,8 @@ def getpiconres(x, y, full, picon, channelname, channelname2, P2, P2A, P2C): name3 = "%s.png" % channelname2.replace('\xc2\x87', '').replace('\xc2\x86', '').decode("utf-8").encode("utf-8") name = normalize('NFKD', unicode(str("" + channelname), 'utf-8', errors='ignore')).encode('ASCII', 'ignore') else: - name2 = "%s.png" % channelname.encode("latin-1", "ignore").decode("utf-8") - name4 = "%s.png" % channelname.encode("utf-8", "ignore").decode("utf-8") + name2 = "%s.png" % channelname + name4 = "%s.png" % channelname name3 = "%s.png" % channelname2.replace('\x87', '').replace('\x86', '') name = normalize('NFKD', str("" + channelname)) name = "%s.png" % sub(r'[^a-z0-9]', '', str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) @@ -10836,8 +10836,8 @@ def getShowCover(BildFile): name3 = "%s.png" % self.Lchannel_name2.replace('\xc2\x87', '').replace('\xc2\x86', '').decode("utf-8").encode("utf-8") name = normalize('NFKD', unicode(str("" + self.Lchannel_name), 'utf-8', errors='ignore')).encode('ASCII', 'ignore') else: - name2 = "%s.png" % self.Lchannel_name.encode("latin-1", "ignore").decode("utf-8") - name4 = "%s.png" % self.Lchannel_name.encode("utf-8", "ignore").decode("utf-8") + name2 = "%s.png" % self.Lchannel_name + name4 = "%s.png" % self.Lchannel_name name3 = "%s.png" % self.Lchannel_name2.replace('\x87', '').replace('\x86', '') name = normalize('NFKD', str("" + self.Lchannel_name)) name = "%s.png" % sub(r'[^a-z0-9]', '', str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) @@ -12043,12 +12043,12 @@ def putPicon(workaround, draw, im): PIC.append(join(P2, picon)) if not PY3: name2 = "%s.png" % self.Lchannel_name.decode("utf-8").encode("latin-1", "ignore") - name4 = "%s.png" % self.Lchannel_name.decode("utf-8").encode("latin-1", "ignore") + name4 = "%s.png" % self.Lchannel_name.decode("utf-8").encode("utf-8", "ignore") name3 = "%s.png" % self.Lchannel_name2.replace('\xc2\x87', '').replace('\xc2\x86', '').decode("utf-8").encode("utf-8") name = normalize('NFKD', self.Lchannel_name.decode('unicode-escape')) else: - name2 = "%s.png" % self.Lchannel_name.encode("latin-1", "ignore").decode("utf-8") - name4 = "%s.png" % self.Lchannel_name.encode("utf-8", "ignore").decode("utf-8") + name2 = "%s.png" % self.Lchannel_name + name4 = "%s.png" % self.Lchannel_name name3 = "%s.png" % self.Lchannel_name2.replace('\x87', '').replace('\x86', '') name = normalize('NFKD', self.Lchannel_name) name = "%s.png" % sub(r'[^a-z0-9]', '', str(name).replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower()) From d2029952dcd7954afa1ed7f4e2bb3864850bc721 Mon Sep 17 00:00:00 2001 From: Hains van den Bosch Date: Sun, 11 Aug 2024 10:16:32 +0200 Subject: [PATCH 17/17] lcd4linux: Use escape character --- lcd4linux/src/configOptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lcd4linux/src/configOptions.py b/lcd4linux/src/configOptions.py index 1e3d90d..a4c90e9 100644 --- a/lcd4linux/src/configOptions.py +++ b/lcd4linux/src/configOptions.py @@ -189,7 +189,7 @@ ['self.list1', 'MJPEG Cycle', ' LCD4linux.MJPEGCycle', 14], ['self.list1', 'MJPEG Restart on Error', ' LCD4linux.MJPEGRestart', 14], ['self.list1', 'MJPEG Header Mode', ' LCD4linux.MJPEGHeader', 14], - ['self.list1', 'Show Streams '4097; 5001...5003' in Mode', ' LCD4linux.Streaming', 0], + ['self.list1', 'Show Streams \'4097; 5001...5003\' in Mode', ' LCD4linux.Streaming', 0], ['self.list1', 'Sonos IP', ' LCD4linux.SonosIP', 19], ['self.list1', 'Sonos Ping Timeout [ms]', ' LCD4linux.SonosPingTimeout', 19], ['self.list1', 'Sonos Play Check', ' LCD4linux.SonosCheckTimer', 19],