Hi,
On my application I had had code as bellow:
Python
class SubsDownloaderApplication(Screen):
skin = """
<screen position="center,80" size="1180,590" title= "Subtitle downloader" >
#......SOME NOT CONNECTED WITH PROBLEM CODE......
</screen>"""
def __init__(self, session, args = 0):
#......SOME NOT CONNECTED WITH PROBLEM CODE......
self.session = session
Screen.__init__(self, session)
self.altservice = self.session.nav.getCurrentlyPlayingServiceReference()
list = []
#......SOME NOT CONNECTED WITH PROBLEM CODE......
if config.plugins.subsdownloader.AutoUpdate.value == True:
autoupdate = AutoUpdateCheck()
if autoupdate == True:
self.session.openWithCallback(self.call_back_AU, MessageBox, _("Do You wish to do ?"), MessageBox.TYPE_YESNO) #THIS LINE GIVES MISTAKE
Alles anzeigen
Line 22 of code had made GreenScreen:
Code
[SubsDownloaderApplication] start
[Picload] <error in Para>
Screen <class 'Plugins.Extensions.SubsDownloader2.plugin.SubsDownloaderApplication'>((), {}): <type 'exceptions.RuntimeError'>
Traceback (most recent call last):
File "/usr/lib/enigma2/python/mytest.py", line 239, in create
return screen(self, *arguments, **kwargs)
File "/usr/lib/enigma2/python/Plugins/Extensions/SubsDownloader2/plugin.py", line 266, in __init__
self.session.openWithCallback(self.call, MessageBox, _("Do You wish to do ?"), MessageBox.TYPE_YESNO)
File "/usr/lib/enigma2/python/mytest.py", line 302, in openWithCallback
dlg = self.open(screen, *arguments, **kwargs)
File "/usr/lib/enigma2/python/mytest.py", line 308, in open
raise RuntimeError("modal open are allowed only from a screen which is modal!")
RuntimeError: modal open are allowed only from a screen which is modal!
[gDesktop] 'NoneType' object has no attribute 'isTmp'
Alles anzeigen
I assume that it's error connected with screen initialization so I changed it on:
Python
class SubsDownloaderApplication(Screen):
skin = """
<screen position="center,80" size="1180,590" title= "Subtitle downloader" >
#......SOME NOT CONNECTED WITH PROBLEM CODE......
</screen>"""
def __init__(self, session, args = 0):
#......SOME NOT CONNECTED WITH PROBLEM CODE......
self.session = session
Screen.__init__(self, session)
self.altservice = self.session.nav.getCurrentlyPlayingServiceReference()
list = []
#......SOME NOT CONNECTED WITH PROBLEM CODE......
if config.plugins.subsdownloader.AutoUpdate.value == True:
autoupdate = AutoUpdateCheck()
if autoupdate == True:
self.onLayoutFinish.append(self.AU_Message) #Execute function when Screen is initialized
def AU_Message(self):
self.session.openWithCallback(self.call_back_AU, MessageBox, _("Do You wish to do ?"), MessageBox.TYPE_YESNO)
Alles anzeigen
Now I've got no GreenScreen but program fall into not expected by me case (Both Application skin and MessageBox are hidden - not shown, on TV I see streamed by satellite TV program, exit key which on my application is to exit don't work).
I assume that I can't check if screen initialisation is finished and in this moment correctly execute " self.session.openWithCallback(self.call_back_AU, MessageBox, _("Do You wish to do ?"), MessageBox.TYPE_YESNO)" command.
Can someone give advice how to correct my second code?