Code cleanup

This commit is contained in:
simon987
2018-04-21 13:27:13 -04:00
parent 4eb9cf6b63
commit 87f35571fa
20 changed files with 811 additions and 856 deletions

View File

@@ -12,6 +12,7 @@ from thumbnail import ThumbnailGenerator
from storage import Directory
import shutil
import config
from ctypes import c_char_p
class RunningTask:
@@ -166,15 +167,13 @@ class TaskManager:
done.value = 1
def cancel_task(self):
self.current_task = None
self.current_process.terminate()
self.current_task.done.value = 1
def check_new_task(self):
if self.current_task is None:
for i in sorted(self.storage.tasks(), reverse=True):
if not self.storage.tasks()[i].completed:
self.start_task(self.storage.tasks()[i])
self.start_task(self.storage.tasks()[i])
else:
if self.current_task.done.value == 1:
@@ -183,3 +182,4 @@ class TaskManager:
self.current_task = None