Skip to content

Commit

Permalink
Merge branch 'Developer' into Python3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Ev0-BH committed Jan 30, 2024
2 parents 8fb872f + 8c90fec commit 48a881d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions lib/python/Components/Addons/Pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/PackageInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Renderer/NextEpgInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Screens/About.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Screens/ChannelSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Tools/Hex2strColor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@


def Hex2strColor(rgb):
return "\c%08x" % rgb # noqa: W605
return r"\c%08x" % rgb # noqa: W605
2 changes: 1 addition & 1 deletion tools/genmetaindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down

0 comments on commit 48a881d

Please sign in to comment.