From e260b201f94a2a1e470b85a6499ea70e20a11277 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 26 Jun 2009 11:37:44 +0200 Subject: Cli stable, able to abort downloads, pause/kill server --- module/download_thread.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/download_thread.py') diff --git a/module/download_thread.py b/module/download_thread.py index 202ebcafb..2c9cc8791 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -22,6 +22,7 @@ import traceback from time import sleep from time import time +from module.network.Request import AbortDownload class Status(object): """ Saves all status information @@ -53,7 +54,6 @@ class Status(object): class Reconnect(Exception): pass - class Download_Thread(threading.Thread): def __init__(self, parent): threading.Thread.__init__(self) @@ -70,6 +70,9 @@ class Download_Thread(threading.Thread): if self.loadedPyFile: try: self.download(self.loadedPyFile) + except AbortDownload: + self.loadedPyFile.plugin.req.abort = False + self.loadedPyFile.status.type = "aborted" except Reconnect: pass except Exception, e: -- cgit v1.2.3