Skip to content

Commit

Permalink
PEP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
TwolDE2 committed Oct 30, 2024
1 parent bce8df2 commit 9081811
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion lib/python/Components/UsageConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,12 +773,13 @@ def EpgSettingsChanged(configElement):

def wdhm(number):
units = ((_("week"), _("day"), _("hour"), _("minute")), (_("weeks"), _("days"), _("hours"), _("minutes")), (7 * 24 * 60, 24 * 60, 60, 1))
for i, d in enumerate(units[2]):
for i, d in enumerate(units[2]):
if unit := int(number / d):
return "%s %s" % (unit, units[0 if unit == 1 else 1][i])
return _("0 minutes")
choices = [(i, wdhm(i)) for i in [i * 15 for i in range(0, 4)] + [i * 60 for i in range(1, 9)] + [i * 120 for i in range(5, 12)] + [i * 24 * 60 for i in range(1, 8)]]
config.epg.histminutes = ConfigSelection(default=0, choices=choices)

def EpgHistorySecondsChanged(configElement):
eEPGCache.getInstance().setEpgHistorySeconds(int(configElement.value) * 60)
config.epg.histminutes.addNotifier(EpgHistorySecondsChanged)
Expand Down
1 change: 1 addition & 0 deletions lib/python/Screens/AudioSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class AudioSelection(ConfigListScreen, Screen):
hooks = []
audioHooks = []
subtitleHooks = []

def __init__(self, session, infobar=None, page=PAGE_AUDIO):
Screen.__init__(self, session)
self["streams"] = List([], enableWrapAround=True)
Expand Down
7 changes: 4 additions & 3 deletions lib/python/Screens/ChannelSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class InsertService(Setup):
def __init__(self, session):
self.createConfig()
Setup.__init__(self, session)

def createConfig(self):
choices = [("Select Service", _("Press 'OK' to select from service list")), ("IPTV stream", _("IPTV stream"))]
if SystemInfo.get("hdmifhdin") or SystemInfo.get("hdmihdin"):
Expand All @@ -85,7 +85,7 @@ def createSetup(self):
self.servicerefstring = '8192:0:1:0:0:0:0:0:0:0::%s' % _("HDMI-IN")
else:
self.servicerefstring = '%s:0:1:0:0:0:0:0:0:0:%s:%s' % (self.streamtype.value, self.streamurl.value.replace(':', '%3a'), self.servicename.value)
self.title = '%s [%s]' % (_("Add a Service"), self.servicerefstring)
self.title = '%s [%s]' % (_("Add a Service"), self.servicerefstring)
SetupList = [(_("Service Type"), self.servicetype, _("Select a service from the service list, or left/right to enter IPTV stream details%s") % (" " + _("or HDMI input") if SystemInfo.get("hdmifhdin") or SystemInfo.get("hdmihdin") else ""))]
if self.servicetype.value != "Select Service":
if self.servicetype.value != "HDMI-in":
Expand All @@ -95,7 +95,7 @@ def createSetup(self):
self["config"].list = SetupList

def changedEntry(self):
if isinstance(self.getCurrentItem(), ConfigText):
if isinstance(self.getCurrentItem(), ConfigText):
self.createSetup()
Setup.changedEntry(self)

Expand All @@ -121,6 +121,7 @@ def keySelect(self):
def selectService(self):
self.session.openWithCallback(self.channelSelectionCallback, SimpleChannelSelection, _("Select channel"))


def getStreamRelayRef(sref):
try:
if "http" in sref:
Expand Down
8 changes: 3 additions & 5 deletions lib/python/Screens/InfoBarGenerics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,8 +1551,6 @@ def showHDMiRecordSetup(self):
if SystemInfo["HDMIin"]:
self.session.openWithCallback(self.mainMenuClosed, Setup, 'HDMIRecord')

def mainMenuClosed(self, *val):
self.session.infobar = None


class InfoBarSimpleEventView:
Expand Down Expand Up @@ -4517,9 +4515,9 @@ def __init__(self):
if SystemInfo['HasHDMIin']:
if not self.hdmi_enabled_full:
self.addExtension((self.getHDMIInFullScreen, self.HDMIInFull, lambda: True), "blue")
# HDMIinPiP causes issues in all tested boxes
# if SystemInfo["HDMIinPiP"] and not self.hdmi_enabled_pip:
# self.addExtension((self.getHDMIInPiPScreen, self.HDMIInPiP, lambda: True), "green")
# HDMIinPiP causes issues in all tested boxes
# if SystemInfo["HDMIinPiP"] and not self.hdmi_enabled_pip:
# self.addExtension((self.getHDMIInPiPScreen, self.HDMIInPiP, lambda: True), "green")

self["HDMIActions"] = HelpableActionMap(self, "InfobarHDMIActions",
{
Expand Down
5 changes: 2 additions & 3 deletions lib/python/Screens/UserInterfacePositioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from enigma import getDesktop

from Components.ActionMap import ActionMap
from Components.config import config, configfile, getConfigListEntry, ConfigSelectionNumber, ConfigSelection, ConfigSlider, ConfigYesNo, NoSave, ConfigNumber
from Components.config import config, configfile, getConfigListEntry, ConfigSelectionNumber, NoSave, ConfigNumber
from Components.ConfigList import ConfigListScreen
from Components.Console import Console
from Components.Sources.StaticText import StaticText
from Components.SystemInfo import SystemInfo, BRAND
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Tools.Directories import fileCheck, fileExists
from Tools.Directories import fileExists


def getFilePath(setting):
Expand Down Expand Up @@ -202,4 +202,3 @@ def run(self):
config.osd.dst_height.save()
configfile.save()
self.close()

4 changes: 2 additions & 2 deletions lib/python/Screens/Wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def startElement(self, name, attrs):
self.wizard[self.lastStep]["config"]["type"] = type
if type in ("ConfigList", "standalone"):
try:
exec("from Screens.%s import *" % attributes.get("module", "None"), globals())
exec("from Screens.%s import *" % attrs.get("module", "None"), globals())
except ImportError:
exec("from %s import *" % attributes.get("module", "None"), globals())
exec("from %s import *" % attrs.get("module", "None"), globals())
self.wizard[self.lastStep]["config"]["screen"] = eval(str(attrs.get('screen')))
if 'args' in attrs:
# print("[wizard]has args")
Expand Down
2 changes: 1 addition & 1 deletion lib/python/StartEnigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def RCSelectionChanged(configelement):
InitiVideomodeHotplug()

profile("InitHDMIRecord")
from Components.HdmiRecord import InitHdmiRecord
from Components.HdmiRecord import InitHdmiRecord # noqa: E402
InitHdmiRecord()

profile("EpgConfig")
Expand Down

0 comments on commit 9081811

Please sign in to comment.