How to memorise a class to call it anywhere.
#1
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
a.fonction()

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 ?
Reply
#2
Ok, so I have find a way. I m using
Code:
xbmcgui.Window(10101).setProperty('stop', '1')
and later to check
if xbmcgui.Window(10101).getProperty('stop') == '1':

But why this code don't work
Code:
WINDOW_PROGRESS = xbmcgui.window( 10101 )
        WINDOW_PROGRESS.close()

Error : Unable to locate window with id -10000. Check skin files
Reply

Logout Mark Read Team Forum Stats Members Help
How to memorise a class to call it anywhere.0