This is probably normal, but I just wanted confirmation from the experts before I introduce ugliness into my code. I have a python script that assigns items to a list like so:
The above code will show the length as 0 in the dialog. But, if I pause the code like so:Code:mc.GetActiveWindow().GetList(120).SetContentURL(currItem.GetPath()) myItems=mc.GetActiveWindow().GetList(120).GetItems() mc.ShowDialogOk("Debug", "classItems length is: " + str(len(classItems))
It will show the correct number of items for classItems. Boxee seems to execute the next line of code in python before it finishes populating the content from SetContentURL(). Using sleep seems like a bad idea because the URL request could take longer than my sleep time.Code:mc.GetActiveWindow().GetList(120).SetContentURL(currItem.GetPath()) time.sleep(5) myItems=mc.GetActiveWindow().GetList(120).GetItems() mc.ShowDialogOk("Debug", "classItems length is: " + str(len(classItems))
Is this normal behavior?
Any ideas on a good way to deal with it?


Reply With Quote
Bookmarks