Strage Problem with script
#1
Hello,

I have the problem that the first click on my list runs fine, the second onClick event hangs...

What am I missing? On the second call I'll get stuck right after that print id

No error message at all. The gui is still reponsive.

Code:
def onClick(self, controlId):
        if controlId == 20:
            
            xbmc.log("viewing current channel details")
            #if (self.lastChannelPos!=None):
            #    self.gChannelList.getListItem(lastChannelPos).select(False)
            
            pos = self.gChannelList.getSelectedPosition()

            
            item = self.gChannelList.getListItem(pos)
            #item.select(True)
            id = item.getLabel2()
            print id
            print "Searching for: "+ str(id)
            for bla in self.channelsList:
                if bla.getId() == id:
                    print "Found"
                    found = bla
            channel = found
            print channel.getDisplayName()
            x = []
            x = channel.getCurrentProgram()
            for prog in x:
                print prog.getTitle()
Reply
#2
I think this trac ticket may be related to your problem as it seems very similar to the problem I encountered. Print messages seem very unreliable when using them in the onClick thread

http://trac.xbmc.org/ticket/9956
Reply
#3
Thanks for your reply!

I'm not as good in python that i could solve/debug such things...

Does this also apply to xbmc.log function?

If so devs should look into this, as it's a potential source for other bugs with python...
Reply
#4
I'm not sure the following is correct(though I haven't been coding in Python for an extremely long time):

Code:
print "Searching for: "+ str(id)

shouldn't it be

Code:
print "Searching for: %s" % str(id)
Reply
#5
well both are good as soon as id is converted to a string, '+' allow to concatenate only same variable type.
Reply

Logout Mark Read Team Forum Stats Members Help
Strage Problem with script0