Diff of /projects/TGScheduler/trunk/tgscheduler/scheduler.py [r7398] .. [r7399] Maximize Restore

  Switch to side-by-side view

--- a/projects/TGScheduler/trunk/tgscheduler/scheduler.py
+++ b/projects/TGScheduler/trunk/tgscheduler/scheduler.py
@@ -193,11 +193,14 @@
     def cancel(self, task):
         """Cancel task by task name.
 
-        @param task: the task.name of the task to cancel
-
-        """
-        si = self._get_scheduler()
-        si.cancel(task)
+        @param task: the task itself or the task.name of the task to cancel
+
+        """
+        si = self._get_scheduler()
+        if isinstance (task, basestring):
+            task = get_task(task)
+        if task:
+            si.cancel(task)
 
 scheduler = Scheduler()