@mfara57,
Here's my function:
def stopjob(self):
try:
exist = self['movielist'].getCurrent()
if exist == None:
return
if exist[2] == "In progress":
config.timeshift.isRecording.value = False
os.system("killall -9 wget")
message = "Stopping " + exist[1] + " - Please Wait!"
message2 = "\n\n" + "Would you like to remove the partially downloaded file?"
self.session.openWithCallback(self.removepartial, MessageBox, _(message + message2), MessageBox.TYPE_YESNO, default = True, timeout = 10)
elif exist[2] == "Waiting":
for job in JobManager.getPendingJobs():
Value = (job, job.name, job.getStatustext())
if job.name == exit(0):
os.system("echo '" + str(Value) + "' > " + "'" + PLUGIN_PATH + "/value.txt'")
break
elif job.name != exit(0):
os.system("echo '" + str(exit(0)) + "' > " + "'" + PLUGIN_PATH + "/exit.txt'")
break
elif exist[2] != "In progress" or "Waiting":
self.session.open(MessageBox, _("You need to select something that's not already Finished!"), MessageBox.TYPE_INFO, timeout = 5)
except Exception as error:
global errormessage
errorscreen = "Error in Screen: xcm_TasksScreen" + "\n"
errordef = "Error in Def: stopjob" + "\n\n"
errormess = "Error Message: " + str(error)
errormessage = errorscreen + errordef + errormess
self.session.open(xcm_error)
For some reason it should print out a text file - but it freezes the stb with no execption, or text file gets generated (I replaced the job.cancel) for debugging purposes.
Edited by mrdude, 14 July 2017 - 17:47.