How to memorise a class to call it anywhere. - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: How to memorise a class to call it anywhere. (/showthread.php?tid=246717) |
How to memorise a class to call it anywhere. - Icerao - 2015-11-07 Hi, I have a little problem, I m making a download system in my addon, and I have a problem to stop it, I need to memorise the function class instance to call a fonction on it (to stop the process). But everyTime a make a call to the class function I do Code: Myclass a So I recreate a new class, and I can't acess to the first one ATM I m using common pluggin cache to memorise a variable, but It s not terrible for performance because I need to check this variable at every loop (and common cache need disk acess too). I have make a try with threading.enumerate(), the downoad is a thread so if I make a thread enumeration I can find the instance and use it but in fact, it's not working at all. I can see all the thread only in the first class call, not the next. I can't get the working progressbarGB instance too, (in fact if I can close it, it will finish the process, but no way to close it) I fact I m searching a way to call a script that work with thread, go away in other addon, and come back later to finish the running thread (and without using disk acess). Anyone have a tips ? RE: How to memorise a class to call it anywhere. - Icerao - 2015-11-11 Ok, so I have find a way. I m using Code: xbmcgui.Window(10101).setProperty('stop', '1') if xbmcgui.Window(10101).getProperty('stop') == '1': But why this code don't work Code: WINDOW_PROGRESS = xbmcgui.window( 10101 ) Error : Unable to locate window with id -10000. Check skin files |