Hi everyone, I apologize if I write on this very old thread, but I would need a hand to finish building a plugin. I created a plugin that searches for channels in bouquets (especially in bouquets of wave channels), and the only thing I can't do (for the moment 😅) is redirect to the channel found. once the search is done, the script produces a list: Channel title found (visible), and as a selection the reference value (#service 1: 0: 0: 0 :). When I click on the channel of my interest it gives me this error:
Code
- {E} /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes 2021-02-28 21: 27: 36 + 0100 [-] TypeError: in method 'eServiceReference___eq__', argument 2 of type 'eServiceReference const &'
- python / python.cpp: 210 call [ePyObject] (PyObject_CallObject (<bound method ActionMap.action of <Components.ActionMap.ActionMap instance at 0xb257b878 >>, ('SetupActions', 'ok') ) failed)
What am I doing wrong? Thank you
This is my code:
This is the function that is called when I do the search.
Python
def listaDir(self, parola):
if len(parola) < 3:
self.session.openWithCallback(self.search(self.session, self.cheRicerca), MessageBox, ("La parola deve contenere almeno un carattere"), MessageBox.TYPE_ERROR, timeout=10, close_on_any_key=True, title='Errore di battuta')
else:
parola = parola.lower()
listChan = []
nList = 1
listBouq = self.cercaBouquet()
self.session.open(MessageBox, (str(listBouq)), MessageBox.TYPE_INFO)
for bou in listBouq:
bouquet = open('/etc/enigma2/' + bou, 'r')
b = bouquet.read()
b = b.split('\n')
b.pop(0)
for result in b:
result = result.lower()
if result.find(parola) != -1:
a = (result.index(parola))
r = result[a:]
listChan.append(((str(nList) + ' ' + r), result))
#nList += 1
nList += 1
if len(listChan) > 0:
self.session.open(SottoMenu, listChan)
else:
self.session.open(MessageBox, ("Non sono stati trovati canali"), MessageBox.TYPE_INFO)
Alles anzeigen
This is the function of my class (which generates another screen with a list of results) and here is the error:
Python
class SottoMenu(Screen):
skin = """
<screen position="100,150" size="460,400" title="Plugin di AldoBel" >
<widget name="sottoMenu" position="10,10" size="420,380" scrollbarMode="showOnDemand" />
</screen>
"""
def __init__(self, session, lista):
self.session = session
self.lista = lista
Screen.__init__(self, session, lista)
self["sottoMenu"] = MenuList(lista)
self["myActionMap"] = ActionMap(["SetupActions"],
{
"ok": self.menuChannel,
"cancel": self.cancel
}, -1)
def menuChannel(self):
returnValue = self["sottoMenu"].l.getCurrentSelection()[1]
returnValue = returnValue.replace("#service ", "")
self.session.nav.stopService()
self.session.nav.playService(returnValue)
def cancel(self):
print("\n[MyMenu] cancel\n")
self.close(None)
Alles anzeigen