Browse Source

added warning for doLater with negative delay time

Joe Shochet 19 years ago
parent
commit
46a0c73e47
1 changed files with 3 additions and 2 deletions
  1. 3 2
      direct/src/task/Task.py

+ 3 - 2
direct/src/task/Task.py

@@ -441,13 +441,14 @@ class TaskManager:
 
     def doMethodLater(self, delayTime, funcOrTask, name, extraArgs=None,
             priority=0, uponDeath=None, appendTask=False):
+        if delayTime < 0:
+            self.notify.warning('doMethodLater: added task: %s with negative delay: %s' % (name, delayTime))
         if isinstance(funcOrTask, Task):
             task = funcOrTask
         elif callable(funcOrTask):
             task = Task(funcOrTask, priority)
         else:
-            self.notify.error(
-                'add: Tried to add a task that was not a Task or a func')
+            self.notify.error('doMethodLater: Tried to add a task that was not a Task or a func')
         task.setPriority(priority)
         task.name = name
         task.extraArgs = extraArgs