Ejemplo n.º 1
0
 def hasTask(self):
     u"""
     <doc>
     The <code>hasTask</code> method answers the boolean flag if there are any pending tasks in the scheduler task
     list. 
     </doc>
     """
     return bool(Task.peek())
Ejemplo n.º 2
0
 def hasTask(self):
     u"""
     
     The ``hasTask`` method answers the boolean flag if there are any pending tasks in the scheduler task
     list. 
     
     """
     return bool(Task.peek())
Ejemplo n.º 3
0
 def hasTask(self):
     u"""
     
     The ``hasTask`` method answers the boolean flag if there are any pending tasks in the scheduler task
     list. 
     
     """
     return bool(Task.peek())
Ejemplo n.º 4
0
 def hasTask(self):
     u"""
     <doc>
     The <code>hasTask</code> method answers the boolean flag if there are any pending tasks in the scheduler task
     list. 
     </doc>
     """
     return bool(Task.peek())
Ejemplo n.º 5
0
 def run(self):
     u"""
     <doc>The <code>run</code> method of the <code>Scheduler</code> class is the main loop that runs infinite, unless
     the <code>self.status</code> is set to a different value than <code>self.C.SCHEDULER_STATUS_RUN</code>. In every
     cycle a new <code>Task</code> is requested from the list of scheduler tasks. If the result is <code>None</code>
     (there are no pending tasks), then the scheduler mode. The method will involuntary sleep for <code>
     self.C.SCHEDULER_SLEEPTIME</code> amount of seconds, before querying the task list again. In the idle state, the
     method calls <code>self.doIdle()</code>, which defaults to do nothing.<br/>
     
     If there is a valid task pending, then <code>self.doTask(task)</code> is called. Note that while there are
     pending tasks, the loop will not sleep.</doc>
     """
     self.status = C.SCHEDULER_STATUS_RUN
     while self.status == C.SCHEDULER_STATUS_RUN:
         task = Task.next()
         if task is not None:
             self.doTask(task)
         else:
             self.doIdle()
             # Involuntary sleep outside doIdle call, which may be inherited and changed,
             time.sleep(C.SCHEDULER_SLEEPTIME)
Ejemplo n.º 6
0
 def run(self):
     u"""
     The ``run`` method of the ``Scheduler`` class is the main loop that runs infinite, unless
     the ``self.status`` is set to a different value than ``self.C.SCHEDULER_STATUS_RUN``. In every
     cycle a new ``Task`` is requested from the list of scheduler tasks. If the result is ``None``
     (there are no pending tasks), then the scheduler mode. The method will involuntary sleep for ``
     self.C.SCHEDULER_SLEEPTIME`` amount of seconds, before querying the task list again. In the idle state, the
     method calls ``self.doIdle()``, which defaults to do nothing.<br/>
     
     If there is a valid task pending, then ``self.doTask(task)`` is called. Note that while there are
     pending tasks, the loop will not sleep.
     """
     self.status = self.C.SCHEDULER_STATUS_RUN
     while self.status == self.C.SCHEDULER_STATUS_RUN:
         task = Task.next()
         if task is not None:
             self.doTask(task)
         else:
             self.doIdle()
             # Involuntary sleep outside doIdle call, which may be inherited and changed,
             time.sleep(self.C.SCHEDULER_SLEEPTIME)
Ejemplo n.º 7
0
 def run(self):
     u"""
     The ``run`` method of the ``Scheduler`` class is the main loop that runs infinite, unless
     the ``self.status`` is set to a different value than ``self.C.SCHEDULER_STATUS_RUN``. In every
     cycle a new ``Task`` is requested from the list of scheduler tasks. If the result is ``None``
     (there are no pending tasks), then the scheduler mode. The method will involuntary sleep for ``
     self.C.SCHEDULER_SLEEPTIME`` amount of seconds, before querying the task list again. In the idle state, the
     method calls ``self.doIdle()``, which defaults to do nothing.<br/>
     
     If there is a valid task pending, then ``self.doTask(task)`` is called. Note that while there are
     pending tasks, the loop will not sleep.
     """
     self.status = self.C.SCHEDULER_STATUS_RUN
     while self.status == self.C.SCHEDULER_STATUS_RUN:
         task = Task.next()
         if task is not None:
             self.doTask(task)
         else:
             self.doIdle()
             # Involuntary sleep outside doIdle call, which may be inherited and changed,
             time.sleep(self.C.SCHEDULER_SLEEPTIME)
Ejemplo n.º 8
0
 def run(self):
     u"""
     <doc>The <code>run</code> method of the <code>Scheduler</code> class is the main loop that runs infinite, unless
     the <code>self.status</code> is set to a different value than <code>self.C.SCHEDULER_STATUS_RUN</code>. In every
     cycle a new <code>Task</code> is requested from the list of scheduler tasks. If the result is <code>None</code>
     (there are no pending tasks), then the scheduler mode. The method will involuntary sleep for <code>
     self.C.SCHEDULER_SLEEPTIME</code> amount of seconds, before querying the task list again. In the idle state, the
     method calls <code>self.doIdle()</code>, which defaults to do nothing.<br/>
     
     If there is a valid task pending, then <code>self.doTask(task)</code> is called. Note that while there are
     pending tasks, the loop will not sleep.</doc>
     """
     self.status = C.SCHEDULER_STATUS_RUN
     while self.status == C.SCHEDULER_STATUS_RUN:
         task = Task.next()
         if task is not None:
             self.doTask(task)
         else:
             self.doIdle()
             # Involuntary sleep outside doIdle call, which may be inherited and changed,
             time.sleep(C.SCHEDULER_SLEEPTIME)