Skip to content

Commit

Permalink
PEP8 double aggressive E225 ~ E228 and E231
Browse files Browse the repository at this point in the history
  • Loading branch information
openvix-bot committed Aug 31, 2023
1 parent e73df27 commit 3028777
Show file tree
Hide file tree
Showing 148 changed files with 991 additions and 991 deletions.
2 changes: 1 addition & 1 deletion data/convert-iso-639-3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
l = {}

with open(infilename, 'r') as f:
f.readline() # throw away header line
f.readline() # throw away header line
for line in f:
item = line.split('\t')
name = (item[6],)
Expand Down
10 changes: 5 additions & 5 deletions lib/python/Components/About.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def getCPUSpeedMHzInt():
except IOError:
cpu_speed = 1700
else:
try: # Solo4K sf8008
try: # Solo4K sf8008
with open("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", "r") as file:
cpu_speed = float(file.read()) // 1000
except IOError:
Expand Down Expand Up @@ -159,10 +159,10 @@ def getIfConfig(ifname):
infos = {}
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# offsets defined in /usr/include/linux/sockios.h on linux 2.6
infos["addr"] = 0x8915 # SIOCGIFADDR
infos["brdaddr"] = 0x8919 # SIOCGIFBRDADDR
infos["hwaddr"] = 0x8927 # SIOCSIFHWADDR
infos["netmask"] = 0x891b # SIOCGIFNETMASK
infos["addr"] = 0x8915 # SIOCGIFADDR
infos["brdaddr"] = 0x8919 # SIOCGIFBRDADDR
infos["hwaddr"] = 0x8927 # SIOCSIFHWADDR
infos["netmask"] = 0x891b # SIOCGIFNETMASK
try:
for k, v in infos.items():
ifreq[k] = _ifinfo(sock, v, ifname)
Expand Down
12 changes: 6 additions & 6 deletions lib/python/Components/Addons/Pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def __init__(self):
GUIAddon.__init__(self)
self.l = eListboxPythonMultiContent()
self.l.setBuildFunc(self.buildEntry)
self.l.setItemHeight(25) # 25 is the height of the default images. For other images set the height in the skin.
self.l.setItemWidth(25) # 25 is the width of the default images. For other images set the width in the skin.
self.l.setItemHeight(25) # 25 is the height of the default images. For other images set the height in the skin.
self.l.setItemWidth(25) # 25 is the width of the default images. For other images set the width in the skin.
self.spacing = applySkinFactor(5)
self.picDotPage = LoadPixmap(resolveFilename(SCOPE_GUISKIN, "icons/dot.png"))
self.picDotCurPage = LoadPixmap(resolveFilename(SCOPE_GUISKIN, "icons/dotfull.png"))
self.showIcons = "showAll" # can be "showAll", "onlyFirst", "onlyLast"
self.showIcons = "showAll" # can be "showAll", "onlyFirst", "onlyLast"
self.orientations = {"orHorizontal": eListbox.orHorizontal, "orVertical": eListbox.orVertical}
self.orientation = eListbox.orHorizontal

Expand Down Expand Up @@ -87,7 +87,7 @@ def postWidgetCreate(self, instance):
instance.allowNativeKeys(False)

def getSourceOrientation(self):
if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu
if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu
orig_source = self.source.master.master
else:
orig_source = self.source
Expand All @@ -101,7 +101,7 @@ def getCurrentIndex(self):
return self.source.l.getCurrentSelectionIndex()

def getSourceSize(self):
if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu
if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu
return self.source.master.master.instance.size()
return self.source.instance.size()

Expand All @@ -113,7 +113,7 @@ def getListCount(self):
return 0

def getListItemSize(self):
if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu
if self.source.__class__.__name__ == "List": # Components.Sources.List, used by MainMenu
orig_source = self.source.master.master
else:
orig_source = self.source
Expand Down
10 changes: 5 additions & 5 deletions lib/python/Components/ChannelsImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import re
from enigma import eServiceReference, eDVBDB
# required methods: Request, urlopen, HTTPError, URLError
from urllib.request import urlopen, Request # raises ImportError in Python 2
from urllib.error import HTTPError, URLError # raises ImportError in Python 2
from urllib.request import urlopen, Request # raises ImportError in Python 2
from urllib.error import HTTPError, URLError # raises ImportError in Python 2

autoClientModeTimer = None

Expand All @@ -32,7 +32,7 @@ def __init__(self):
self.clientmodeactivityTimer = eTimer()
self.clientmodeactivityTimer.timeout.get().append(self.clientmodedatedelay)
now = int(time())
self.doautostartscan() # import at boot time
self.doautostartscan() # import at boot time

global ClientModeTime
if config.clientmode.enableSchedule.value:
Expand Down Expand Up @@ -62,7 +62,7 @@ def getClientModeTime(self):
backupclock = config.clientmode.scheduletime.value
nowt = time()
now = localtime(nowt)
if config.clientmode.scheduleRepeatInterval.value.isdigit(): # contains wait time in minutes
if config.clientmode.scheduleRepeatInterval.value.isdigit(): # contains wait time in minutes
repeatIntervalMinutes = int(config.clientmode.scheduleRepeatInterval.value)
return int(mktime((now.tm_year, now.tm_mon, now.tm_mday, now.tm_hour, now.tm_min + repeatIntervalMinutes, 0, now.tm_wday, now.tm_yday, now.tm_isdst)))
return int(mktime((now.tm_year, now.tm_mon, now.tm_mday, backupclock[0], backupclock[1], 0, now.tm_wday, now.tm_yday, now.tm_isdst)))
Expand All @@ -74,7 +74,7 @@ def clientmodedate(self, atLeast=0):
now = int(time())
if ClientModeTime > 0:
if ClientModeTime < now + atLeast:
if config.clientmode.scheduleRepeatInterval.value.isdigit(): # contains wait time in minutes
if config.clientmode.scheduleRepeatInterval.value.isdigit(): # contains wait time in minutes
ClientModeTime = now + (60 * int(config.clientmode.scheduleRepeatInterval.value))
while (int(ClientModeTime) - 30) < now:
ClientModeTime += 60 * int(config.clientmode.scheduleRepeatInterval.value)
Expand Down
4 changes: 2 additions & 2 deletions lib/python/Components/ConditionalWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def __init__(self):

def activateCondition(self, condition):
if condition:
if not self.blinking: # we are already blinking
if not self.blinking: # we are already blinking
self.startBlinking()
else:
if self.blinking: # we are blinking
if self.blinking: # we are blinking
self.stopBlinking()
2 changes: 1 addition & 1 deletion lib/python/Components/Console.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, containers, cmd, callback, extra_args, binary=False):
self.container = enigma.eConsoleAppContainer()
self.containers = containers
self.binary = binary
if isinstance(cmd, str): # until .execute supports a better api
if isinstance(cmd, str): # until .execute supports a better api
cmd = [cmd]
# Create a unique name
name = cmd[0]
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Converter/EventName.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class EventName(Converter):
# Arguments...
"Name": ("type", NAME),
"Description": ("type", SHORT_DESCRIPTION),
"ShortDescription": ("type", SHORT_DESCRIPTION), # added for consistency with MovieInfo
"ShortDescription": ("type", SHORT_DESCRIPTION), # added for consistency with MovieInfo
"ExtendedDescription": ("type", EXTENDED_DESCRIPTION),
"FullDescription": ("type", FULL_DESCRIPTION),
"ID": ("type", ID),
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Converter/EventTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def getTime(self):
info = reference and self.source.info
if info is None:
return
test = ['IBDCX', (reference.toString(), 1, -1, 1440)] # search next 24 hours
test = ['IBDCX', (reference.toString(), 1, -1, 1440)] # search next 24 hours
self.list = [] if self.epgcache is None else self.epgcache.lookupEvent(test)
if self.list:
try:
Expand Down
6 changes: 3 additions & 3 deletions lib/python/Components/Converter/FrontendInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def getText(self):
assert self.type not in (self.LOCK, self.SLOT_NUMBER), "the text output of FrontendInfo cannot be used for lock info"
percent = None
swapsnr = config.usage.swap_snr_on_osd.value
colors = parameters.get("FrontendInfoColors", (0x0000FF00, 0x00FFFF00, 0x007F7F7F)) # tuner active, busy, available colors
if self.type == self.BER: # as count
colors = parameters.get("FrontendInfoColors", (0x0000FF00, 0x00FFFF00, 0x007F7F7F)) # tuner active, busy, available colors
if self.type == self.BER: # as count
count = self.source.ber
if count is not None:
return str(count)
Expand All @@ -62,7 +62,7 @@ def getText(self):
elif self.type == self.SNR or self.type == self.SNRdB:
if self.source.snr_db is not None:
return _("%3.01f dB") % (self.source.snr_db / 100.0)
elif self.source.snr is not None: #fallback to normal SNR...
elif self.source.snr is not None: # fallback to normal SNR...
percent = self.source.snr
elif self.type == self.TUNER_TYPE:
return self.source.frontend_type or _("Unknown")
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Converter/HddState.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, type):
self.timer.callback.append(self.updateHddState)
self.idle_time = int(config.usage.hdd_standby.value)
config.usage.hdd_standby.addNotifier(self.setStandbyTime, initial_call=False)
self.colors = parameters.get("HddStateColors", (0x00FFFF00, 0x0000FF00)) # standby - yellow, active - green
self.colors = parameters.get("HddStateColors", (0x00FFFF00, 0x0000FF00)) # standby - yellow, active - green
if self.hdd_list:
self.updateHddState(force=True)
if self.onPartitionAddRemove not in harddiskmanager.on_partition_list_change:
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Converter/MovieInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MovieInfo(Converter):
MOVIE_REC_SERVICE_REF = 3 # referance of recording service
MOVIE_REC_FILESIZE = 4 # filesize of recording
MOVIE_FULL_DESCRIPTION = 5 # combination of short and long description when available
MOVIE_NAME = 6 # recording name
MOVIE_NAME = 6 # recording name

KEYWORDS = {
# Arguments...
Expand Down
18 changes: 9 additions & 9 deletions lib/python/Components/Converter/PliExtraInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def __init__(self, type):
"ResolutionString",
),
"TransponderInfo": (
( # not feraw
( # not feraw
"StreamURLInfo",
),
( # feraw and "DVB-T" not in feraw.get("tuner_type", "")
Expand Down Expand Up @@ -224,17 +224,17 @@ def getCryptoInfo(self, info):
def createCryptoBar(self, info):
res = ""
available_caids = info.getInfoObject(iServiceInformation.sCAIDs)
colors = parameters.get("PliExtraInfoColors", (0x0000FF00, 0x00FFFF00, 0x007F7F7F, 0x00FFFFFF)) # "found", "not found", "available", "default" colors
colors = parameters.get("PliExtraInfoColors", (0x0000FF00, 0x00FFFF00, 0x007F7F7F, 0x00FFFFFF)) # "found", "not found", "available", "default" colors

for caid_entry in caid_data:
if int(caid_entry[0], 16) <= int(self.current_caid, 16) <= int(caid_entry[1], 16):
color = Hex2strColor(colors[0]) # green
color = Hex2strColor(colors[0]) # green
else:
color = Hex2strColor(colors[2]) # grey
color = Hex2strColor(colors[2]) # grey
try:
for caid in available_caids:
if int(caid_entry[0], 16) <= caid <= int(caid_entry[1], 16):
color = Hex2strColor(colors[1]) # yellow
color = Hex2strColor(colors[1]) # yellow
except:
pass

Expand All @@ -243,7 +243,7 @@ def createCryptoBar(self, info):
res += " "
res += color + caid_entry[3]

res += Hex2strColor(colors[3]) # white (this acts like a color "reset" for following strings
res += Hex2strColor(colors[3]) # white (this acts like a color "reset" for following strings
return res

def createCryptoSeca(self, info):
Expand Down Expand Up @@ -636,10 +636,10 @@ def createOrbPosOrTunerSystem(self, fedata, feraw):

def createTransponderName(self, feraw):
orbpos = feraw.get("orbital_position")
if orbpos is None: # Not satellite
if orbpos is None: # Not satellite
return ""
freq = feraw.get("frequency")
if freq and freq < 10700000: # C-band
if freq and freq < 10700000: # C-band
if orbpos > 1800:
orbpos += 1
else:
Expand Down Expand Up @@ -982,7 +982,7 @@ def getBool(self):
if request_selected:
if int(caid_entry[0], 16) <= int(current_caid, 16) <= int(caid_entry[1], 16):
return True
else: # request available
else: # request available
try:
for caid in available_caids:
if int(caid_entry[0], 16) <= caid <= int(caid_entry[1], 16):
Expand Down

0 comments on commit 3028777

Please sign in to comment.