Call function from script or plugin from skin?
#1
Could not find a way to do this.

So i have a script or plugin (undecided yet) that has something like:

Code:
def WriteBlaBla(Name, Node):

In a script/plugin that is inside the skin/scripts folder.
So can i call that directly as onclick instead of XBMC.RunScript?
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#2
For a skin to get a script to do something, you need to send it arguments.
Code:
<onclick>XBMC.RunScript("path to script","clear")</onclick>

Then in the python script,
Code:
import xbmc

def clear_function():
    # put code here

def exit_function():
    # put code here

if ( __name__ == "__main__" ):
    if len(sys.argv[ 1 ]) > 0:
        if sys.argv[1] == "clear":
            clear_function()
        elif sys.argv[1] == "exit":
            exit_function()
    else:
        xbmc.log( "No Arguments sent", xbmc.LOGNOTICE )


Also if you need any help with you 'wizard' efforts, please shot me a PM
Reply
#3
I do, and i did and thnx for this.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply

Logout Mark Read Team Forum Stats Members Help
Call function from script or plugin from skin?0