diff --git a/lib/python/Components/Addons/Pager.py b/lib/python/Components/Addons/Pager.py index b11ba82728..4544db09ba 100644 --- a/lib/python/Components/Addons/Pager.py +++ b/lib/python/Components/Addons/Pager.py @@ -35,6 +35,9 @@ def onContainerShown(self): if hasattr(self.source, "instance") and hasattr(self.source.instance, "setScrollbarMode"): self.source.instance.setScrollbarMode(eListbox.showNever) + if self.source and hasattr(self.source, "onVisibilityChange"): + self.source.onVisibilityChange.append(self.onSourceVisibleChanged) + onSelectionChanged = x if (x := getattr(self.source, "onSelectionChanged", None)) is not None else getattr(self.source, "onSelChanged", None) if isinstance(onSelectionChanged, list) and self.initPager not in onSelectionChanged: @@ -44,6 +47,12 @@ def onContainerShown(self): GUI_WIDGET = eListbox + def onSourceVisibleChanged(self, visible): + if visible: + self.show() + else: + self.hide() + def buildEntry(self, currentPage, pageCount): width = self.l.getItemSize().width() height = self.l.getItemSize().height() diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 70eecc555d..e128c82113 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -183,7 +183,7 @@ def loadNetworkConfig(self, iface, callback=None): callback(True) def loadNameserverConfig(self): - ipRegexp = "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" # noqa: W605 + ipRegexp = r"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" # noqa: W605 nameserverPattern = re.compile("nameserver +" + ipRegexp) ipPattern = re.compile(ipRegexp) diff --git a/lib/python/Components/PackageInfo.py b/lib/python/Components/PackageInfo.py index 9632984a75..4e4a180c66 100644 --- a/lib/python/Components/PackageInfo.py +++ b/lib/python/Components/PackageInfo.py @@ -190,7 +190,7 @@ def fillPackagesList(self, prerequisites=True): self.directory = [self.directory] for directory in self.directory: - packages += crawlDirectory(directory, ".*\.info$") # noqa: W605 + packages += crawlDirectory(directory, r".*\.info$") # noqa: W605 for package in packages: self.readInfo(package[0] + "/", package[0] + "/" + package[1]) diff --git a/lib/python/Components/Renderer/NextEpgInfo.py b/lib/python/Components/Renderer/NextEpgInfo.py index a05bff4ad4..d6bf909333 100644 --- a/lib/python/Components/Renderer/NextEpgInfo.py +++ b/lib/python/Components/Renderer/NextEpgInfo.py @@ -16,7 +16,7 @@ def __init__(self): self.hideLabel = 0 self.timecolor = "" self.labelcolor = "" - self.foregroundColor = "\c00f0f0f0" # noqa: W605 + self.foregroundColor = r"\c00f0f0f0" # noqa: W605 self.numOfSpaces = 1 GUI_WIDGET = eLabel diff --git a/lib/python/Screens/About.py b/lib/python/Screens/About.py index 832e5eacb7..f6dcb46a85 100644 --- a/lib/python/Screens/About.py +++ b/lib/python/Screens/About.py @@ -97,7 +97,7 @@ def populate(self): tempinfo = "" elif path.exists("/proc/hisi/msp/pm_cpu"): try: - tempinfo = search("temperature = (\d+) degree", open("/proc/hisi/msp/pm_cpu").read()).group(1) # noqa: W605 + tempinfo = search(r"temperature = (\d+) degree", open("/proc/hisi/msp/pm_cpu").read()).group(1) # noqa: W605 except: tempinfo = "" if tempinfo and int(tempinfo) > 0: diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index aefa75c205..30738670a5 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -1343,7 +1343,7 @@ def exitContext(self, close=False): class ChannelSelectionBase(Screen, HelpableScreen): - orbposReStr = "\(satellitePosition *== *(\d+)" # noqa: W605 + orbposReStr = r"\(satellitePosition *== *(\d+)" # noqa: W605 orbposRe = None # Lazy compilation def __init__(self, session): diff --git a/lib/python/Tools/Hex2strColor.py b/lib/python/Tools/Hex2strColor.py index 4bb4e98f79..7d7d7b68de 100644 --- a/lib/python/Tools/Hex2strColor.py +++ b/lib/python/Tools/Hex2strColor.py @@ -3,4 +3,4 @@ def Hex2strColor(rgb): - return "\c%08x" % rgb # noqa: W605 + return r"\c%08x" % rgb # noqa: W605 diff --git a/tools/genmetaindex.py b/tools/genmetaindex.py index 9422db6663..b1cde7cfda 100644 --- a/tools/genmetaindex.py +++ b/tools/genmetaindex.py @@ -21,7 +21,7 @@ for i in p.findall("info"): if not info: info = i - assert info + assert info is not None for i in info[:]: if i.tag not in ["name", "packagename", "packagetype", "shortdescription"]: