2010-10-27, 10:59
Good morning,
I have sortTV set up to run every few hours, and I have a button on my remote programmed to update my library. But I am trying to write a little python script that combines the 2 activities, so that when I press the update library button on my remote the script activates my sort TV bat file, waits a few seconds and then updates the library.
This is the first time I have looked at python, so bare with me.
I think this will work, but can any one spot any obvious faults?
The next question how do I launch this from my keyboard.xml? I think it works like this:
Is that right? Is there a way to use a relative path to the script (rather than absolute path)?
I have sortTV set up to run every few hours, and I have a button on my remote programmed to update my library. But I am trying to write a little python script that combines the 2 activities, so that when I press the update library button on my remote the script activates my sort TV bat file, waits a few seconds and then updates the library.
This is the first time I have looked at python, so bare with me.
Quote: import xbmc
import os.system
import time
xbmc.executebuiltin(' Notification(Updater, Update process underway, 5) ')
os.system("C:\\strawberrry\\Z_Sort_TV\\SorTV.bat")
time.sleep(10)
#10 second sleep
xbmc.executebuiltin('UpdateLibrary(video)')
xbmc.executebuiltin('CleanLibrary(video)')
I think this will work, but can any one spot any obvious faults?
The next question how do I launch this from my keyboard.xml? I think it works like this:
Quote:<d mod="ctrl,alt"> xbmc.executescript('C:\\Program Files\\XBMC\\Scripts\\Updater.py')</d>
Is that right? Is there a way to use a relative path to the script (rather than absolute path)?