parameters: (
          self, action, taskname, cron_str, processmethod, args, kw
      )
return_statement: return task
docstring: Add a new Cron-like Task to the schedule.
docstring_summary: Add a new Cron-like Task to the schedule.
docstring_tokens: Add a new Cron - like Task to the schedule .
function: def add_cron_like_task(
          self, action, taskname, cron_str, processmethod, args, kw
      ):
          """Add a new Cron-like Task to the schedule."""
          if not args:
              args = []
          if not kw:
              kw = {}
          if processmethod == method.sequential:
              TaskClass = CronLikeTask
          elif processmethod == method.threaded:
              TaskClass = ThreadedCronLikeTask
          elif processmethod == method.forked:
              TaskClass = ForkedCronLikeTask
          else:
              raise ValueError("Invalid processmethod")
          if self.running:
              self._acquire_lock()
              try:
                  if taskname in self.tasks:
                      raise ValueError(
                          "A task with the name %s already exists" % taskname)
              finally:
                  self._release_lock()
          else:
              if taskname in self.tasks:
                  raise ValueError(
                      "A task with the name %s already exists" % taskname)
          task = TaskClass(taskname, action, cron_str, args, kw)
          firsttime = task.get_schedule_time()
          self.schedule_task_abs(task, firsttime)
          return task
function_tokens: def add_cron_like_task ( self , action , taskname , cron_str , processmethod , args , kw ) : if not args : args = [ ] if not kw : kw = { } if processmethod == method . sequential : TaskClass = CronLikeTask elif processmethod == method . threaded : TaskClass = ThreadedCronLikeTask elif processmethod == method . forked : TaskClass = ForkedCronLikeTask else : raise ValueError ( "Invalid processmethod" ) if self . running : self . _acquire_lock ( ) try : if taskname in self . tasks : raise ValueError ( "A task with the name %s already exists" % taskname ) finally : self . _release_lock ( ) else : if taskname in self . tasks : raise ValueError ( "A task with the name %s already exists" % taskname ) task = TaskClass ( taskname , action , cron_str , args , kw ) firsttime = task . get_schedule_time ( ) self . schedule_task_abs ( task , firsttime ) return task