2004-07-14, 10:45
i've been playing around with .spy files that can be accessed through the webserver (e.g. //xboxip/myscript.spy?variable=whatever)
now spy is a little more unforgiving as to the syntax used so you can't just rename your .py to .spy and expect it to work. indentation is not recognised well so you have to use {} around "indented" code. python chunks should be surrounded with \ and (wiki).
access to xmbc and xbmcgui is supported the normal way, but it seems not all methods can be called from within a .spy file (e.g. it complains if you try to use xbmc.playlist(0), saying it doesn't exist. the player() does however.)
i suppose the most usefull script in spy would be:
i'm not sure if/how you can pass parameters to the .py script.
to sum up my questions in this post:
1. why can't .spy scripts see the xbmc.playlist() method ?
2. how do you pass parameters to .py scripts
now spy is a little more unforgiving as to the syntax used so you can't just rename your .py to .spy and expect it to work. indentation is not recognised well so you have to use {} around "indented" code. python chunks should be surrounded with \ and (wiki).
access to xmbc and xbmcgui is supported the normal way, but it seems not all methods can be called from within a .spy file (e.g. it complains if you try to use xbmc.playlist(0), saying it doesn't exist. the player() does however.)
i suppose the most usefull script in spy would be:
Quote:[[\name the .spy file execute.spy and call this using //xboxip/execute.spy?name='q://scripts/myscript.py
import xbmc
scriptname = request(name)
xmbc.executescript(scriptname)
]]
i'm not sure if/how you can pass parameters to the .py script.
to sum up my questions in this post:
1. why can't .spy scripts see the xbmc.playlist() method ?
2. how do you pass parameters to .py scripts