Skip to content

Commit

Permalink
[ScanSetup] show error message when not cable scan utility (#3306)
Browse files Browse the repository at this point in the history
- first init self.tlist as None
-add more dvb-s config when emtpy sat list
  • Loading branch information
Dima73 committed Jan 22, 2022
1 parent 005eb6f commit 7eea5e7
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions lib/python/Screens/ScanSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from Components.Label import Label
from Tools.HardwareInfo import HardwareInfo
from Tools.Transponder import getChannelNumber, supportedChannels, channel2frequency
from Tools.Directories import fileExists
from Screens.InfoBar import InfoBar
from Screens.MessageBox import MessageBox
from enigma import eTimer, eDVBFrontendParametersSatellite, eComponentScan, eDVBFrontendParametersTerrestrial, eDVBFrontendParametersCable, eConsoleAppContainer, eDVBResourceManager, eDVBFrontendParametersATSC
Expand Down Expand Up @@ -299,17 +300,22 @@ def GetCommand(nim_idx):
bus = 4 # DM8000 second num is /dev/i2c/4

if tunername == "CXD1981":
bin_name = "CXD1981"
exe_path = "/usr/bin/cxd1978"
cmd = "cxd1978 --init --scan --verbose --wakeup --inv 2 --bus %d" % bus
elif tunername == "ATBM781x":
bin_name = "ATBM781x"
exe_path = "/usr/bin/atbm781x"
cmd = "atbm781x --init --scan --verbose --wakeup --inv 2 --bus %d" % bus
elif tunername.startswith("Sundtek"):
bin_name = "mediaclient"
cmd = "/opt/bin/mediaclient --blindscan %d" % nim_idx
exe_path = "/opt/bin/mediaclient"
cmd = "%s --blindscan %d" % (exe_path, nim_idx)
else:
bin_name = GetCommand(nim_idx)
cmd = "%(BIN_NAME)s --init --scan --verbose --wakeup --inv 2 --bus %(BUS)d" % {'BIN_NAME': bin_name, 'BUS': bus}
exe_path = "/usr/bin/%s" % bin_name
cmd = "%s --init --scan --verbose --wakeup --inv 2 --bus %d" % (bin_name, bus)

if not fileExists(exe_path):
self.session.open(MessageBox, _("Cable scan executable utility not found '%s'!") % exe_path, MessageBox.TYPE_ERROR)
return

if cableConfig.scan_type.value == "bands":
cmd += " --scan-bands "
Expand Down Expand Up @@ -364,7 +370,7 @@ def GetCommand(nim_idx):
cmd += " --sr "
cmd += str(cableConfig.scan_sr_ext2.value)
cmd += "000"
print bin_name, " CMD is", cmd
print exe_path, " CMD is", cmd

self.cable_search_container.execute(cmd)
tmpstr = _("Looking for active transponders in the cable network. Please wait...")
Expand Down Expand Up @@ -1007,7 +1013,7 @@ def createConfig(self, frontendData):
for n in nimmanager.nim_slots:
if n.config_mode == "nothing":
continue
if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
if n.config_mode in ("simple", "equal", "advanced") and len(nimmanager.getSatListForNim(n.slot)) < 1:
continue
if n.config_mode in ("loopthrough", "satposdepends"):
root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.value))
Expand Down Expand Up @@ -1346,6 +1352,7 @@ def keyGoCheckTimeshiftCallback(self, answer):
if not answer or self.scan_nims.value == "":
return
tlist = []
self.tlist = None
flags = 0
removeAll = True
action = START_SCAN
Expand Down Expand Up @@ -1814,6 +1821,7 @@ def keyGoCheckTimeshiftCallback(self, answer):
self.scanList = []
self.known_networks = set()
self.nim_iter = 0
self.tlist = None
self.buildTransponderList()

def buildTransponderList(self): # this method is called multiple times because of asynchronous stuff
Expand Down

0 comments on commit 7eea5e7

Please sign in to comment.