2009-03-24, 11:03
Hello to everyone. My first post :-) ... clemency, please ;-)
I wrote a plugin (starting from an existing one).
Every click on a file/folder my default.py is called.
In default.py I use an object 'o' and I do someting like:
<default.py>
...
o = MyClass()
o.load()
for elem in o.elems():
...elem.doSomething()
...
...
o.load() is time consuming.
I'd like to know if is it possible to store objetc 'o' in the first execution of default.py and use it next times.
something like (I know thant xbmc.getCache and xbmc.setCache o not exist) :
<default.py>
...
o = xbmc.getCache('myobject')
if not o:
...o = MyClass()
...o.load()
for elem in o.elems():
...elem.doSomething()
xbmc.setCache(o, 'myobject')
Or do something similar to 'plugin scope', 'plugin init', 'plugin terminate' exist? (or plugin are stateless?)
Alternative solution is to use files to store object. Right?
Thanks and regards
zulio
I wrote a plugin (starting from an existing one).
Every click on a file/folder my default.py is called.
In default.py I use an object 'o' and I do someting like:
<default.py>
...
o = MyClass()
o.load()
for elem in o.elems():
...elem.doSomething()
...
...
o.load() is time consuming.
I'd like to know if is it possible to store objetc 'o' in the first execution of default.py and use it next times.
something like (I know thant xbmc.getCache and xbmc.setCache o not exist) :
<default.py>
...
o = xbmc.getCache('myobject')
if not o:
...o = MyClass()
...o.load()
for elem in o.elems():
...elem.doSomething()
xbmc.setCache(o, 'myobject')
Or do something similar to 'plugin scope', 'plugin init', 'plugin terminate' exist? (or plugin are stateless?)
Alternative solution is to use files to store object. Right?
Thanks and regards
zulio