2012-06-01, 19:52
I could use some scripting guidance. I am trying to write a simple script for my own personal use which would delete the active video (ListItem) after it has stopped playing when the Delete key is pressed on the Active window.. I am using the Confluence skin under Eden on a Win7 platform.
Here is what I have:
---------------------------
Here is what I have:
---------------------------
Code:
import xbmc, xbmcgui, os, sys
class Main:
""" Delete file from the OS """
def delete_file(self, file):
if os.path.exists(file):
os.remove(file)
""" Deleted """
self.notify(__settings__.getLocalizedString(30014) + ' ' + file)
""" Finally clean the library to account for any deleted videos """
if doClean and self.cleanLibrary:
xbmc.executebuiltin("XBMC.CleanLibrary(video)")
run = Main()
Will this work or am I missing something?