Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def as_cmd(self):
factory = (
schedule.PeriodicCommandFixedDelay.daily_at
if isinstance(self.when, datetime.time)
else schedule.DelayedCommand.at_time
)
return factory(self.when, self)
def execute_at(self, when, func):
self.add(schedule.DelayedCommand.at_time(when, func))
def execute_at(self, when, func):
self.add(schedule.DelayedCommand.at_time(when, func))