Example #1
0
    def toggleCancelLoading(self):
        if Task.getInstance() is not None and not Task.getInstance().isCancelling():
            self["status_label"].setText("Canceling...")
            Task.getInstance().setCancel()

        elif Task.getInstance() is not None and Task.getInstance().isCancelling():
            self["status_label"].setText("Loading...")
            Task.getInstance().setResume()
        else:
            log.debug("Task is not running")
Example #2
0
    def toggleCancelLoading(self):
        if Task.getInstance() is not None and not Task.getInstance().isCancelling():
            self["status_label"].setText("Canceling...")
            Task.getInstance().setCancel()

        elif Task.getInstance() is not None and Task.getInstance().isCancelling():
            self["status_label"].setText("Loading...")
            Task.getInstance().setResume()
        else:
            log.debug("Task is not running")
Example #3
0
 def wrapped_func(*args, **kwargs):
     task = Task.getInstance()
     if task and task._aborted:
         raise AddonThreadException()
     func(*args, **kwargs)
Example #4
0
 def wrapped_func(*args, **kwargs):
     task = Task.getInstance()
     if task and task._aborted:
         raise AddonThreadException()
     func(*args, **kwargs)