runscript not executing my script but others very vell
#1
Hi!

I hope, this doesn't get too confusing:

Two Problems. The first:
I call WindowXML windows by using RunScript. Inside this window I call another window the same way.
From inside this window I am not able anymore to use RunScript from the script to call other windows. Using RunScript from the xml-file works.
And, not calling a script of mine but any other script (like TAC.TV) works.
Calling the same (my) script already from the home window works. It just doesn't when being called from somewhere "inside".

Second Problem:
Imagine the following menu structure:
Code:
MainMenu (portal.py and Portal.xml)
- Vod Overview (vodOverview.py and VodOverview.xml)
-- Top Movies & Series (vodSubCategories.py and VodSubCategories.xml)
--- Movies (vodSubCategories.py and VodSubCategories.xml)
---- New (contains movies)
---- Action (contains movies)
---- Comedy (contains movies)
---- ... (contains movies)
--- Children (vodSubCategories.py and VodSubCategories.xml)
---- ... (contains movies)
--- Erotic (vodSubCategories.py and VodSubCategories.xml)
---- ... (contains movies)
-- Best of TV (vodSubCategories.py and VodSubCategories.xml)
--- ... (vodSubCategories.py and VodSubCategories.xml)
---- ... (contains movies)
As you can see, vodOverview is re-used for the category listings. That means, the window is not called again when entering a subcategory, but the list control is removed, new data is fetched and then the list is being filled with the new data.
Usually, I can go back to the previous window by pushing either MENU or BACK on the remote control. This stops working as soon as I'm inside eg the movies category. Instead, I get a
Code:
exception in CApplication::FrameMove()
log entry for every push of the MENU or BACK button.
Clicking on a subcategory works and (as you can see below) gets me back to the home window.
This is my onClick code:
Code:
def onClick(self, controlID):
        """
            Notice: onClick not onControl
            Notice: it gives the ID of the control not the control object
        """
        try:
          print "onClick(): controlID=%i" % controlID
            
            selItem = self.list.getSelectedItem()
            id = str(selItem.getProperty("id"))
            hasChild = selItem.getProperty("hasChild")
            
            if self.type == "videos":
              print 'videos: ' + id
              
            else:
            print 'id: ' + id + ', hasChild: ' + hasChild
              
            if hasChild[0].upper() == 'F':
              xbmcgui.Dialog().ok('DEMO', 'Not available in demo!')
              xbmc.executebuiltin('XBMC.ActivateWindow(Home)')
              #(does not work, but the line above does)xbmc.executebuiltin('XBMC.RunScript(q:\skin\myskin\scripts\portal.py))
  
            else:
                self.type = "categoryId"
                self.typeValue = id
                
                self.removeControl(self.list)
                self.createList()
                self.doFetch() #this is also called from onInit the first time
            
            print 'after ex'
          except StandardError, e:
            print 'onClick Fehler: ', e

Could it be that something like a stack overflow occurs when calling runscript too often?
Do I explicitly have to do some close or unload stuff to prevent this misbehaviour?

btw: on the bottom of every script i have the following code (of course the xml names change)
Code:
win = VodOverview("VodOverview.xml", os.getcwd(), "Default", 0)
win.doModal()
del win

Maybe someone can tell me a link to a good WindowXML example.. It seems to me that all the skins and scripts which are already available do not make much use of that WindowXML stuff yet.

I have found out by googling that this FrameMove exception seems to be an error which has been tried to being solved many times but has not been reproducable until now...
I guess, I have been able to reproduce this.
Reply
#2
I was able to solve the second problem by using
Code:
self.list.reset()
instead of removing the list from the control and then creating a new one...

however, the runscript problem is still existing...
Reply
#3
Hi martingu1979,

Try to save your .py file to UNIX format (LF). I had similar problem, especially using import and it solved it, not sure why.
I am not sure it would apply to your case, but give it a try we never know. I hope it will help you.
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply

Logout Mark Read Team Forum Stats Members Help
runscript not executing my script but others very vell0