Skip to content

Commit

Permalink
fix some sonar warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jbleyel committed Oct 30, 2024
1 parent 23d8020 commit 0b17a08
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def listAccessPoints(self):
complist.remove(compentry)
for entry in complist:
self.APList.append((entry[1], entry[1]))
if not len(aps):
if not aps:
self.APList.append((_("No networks found"), None))

self.rescanTimer.start(4000)
Expand Down
32 changes: 16 additions & 16 deletions lib/python/Screens/ChannelSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,26 @@
config.servicelist.startupmode = ConfigText(default="tv")


def parseCurentEvent(list, isZapTimer=False): # IanSav: This is only used once in here, why is it a global method?
if len(list) >= 0:
list = list[0]
begin = list[2] - (getattr(config.recording, "zap_margin_before" if isZapTimer else "margin_before").value * 60)
end = list[2] + list[3] + (getattr(config.recording, "zap_margin_after" if isZapTimer else "margin_after").value * 60)
name = list[1]
description = list[5]
eit = list[0]
def parseCurentEvent(items, isZapTimer=False): # IanSav: This is only used once in here, why is it a global method?
if items:
item = items[0]
begin = item[2] - (getattr(config.recording, "zap_margin_before" if isZapTimer else "margin_before").value * 60)
end = item[2] + item[3] + (getattr(config.recording, "zap_margin_after" if isZapTimer else "margin_after").value * 60)
name = item[1]
description = item[5]
eit = item[0]
return begin, end, name, description, eit
return False


def parseNextEvent(list, isZapTimer=False): # IanSav: This is only used in once class in here, why is it a global method?
if len(list) > 0:
list = list[1]
begin = list[2] - (getattr(config.recording, "zap_margin_before" if isZapTimer else "margin_before").value * 60)
end = list[2] + list[3] + (getattr(config.recording, "zap_margin_after" if isZapTimer else "margin_after").value * 60)
name = list[1]
description = list[5]
eit = list[0]
def parseNextEvent(items, isZapTimer=False): # IanSav: This is only used in once class in here, why is it a global method?
if items and len(items) > 1:
item = items[1]
begin = item[2] - (getattr(config.recording, "zap_margin_before" if isZapTimer else "margin_before").value * 60)
end = item[2] + item[3] + (getattr(config.recording, "zap_margin_after" if isZapTimer else "margin_after").value * 60)
name = item[1]
description = item[5]
eit = item[0]
return begin, end, name, description, eit
return False
# IanSav: These two are almost identical and can be combined to reduce toe code size with almost no cost!
Expand Down

0 comments on commit 0b17a08

Please sign in to comment.