Example #1
0
	def __init__(self, func, when, *argums, start_time=None, name=None, repeating=True,
			threaded=True, ignore_exceptions=False, retrys=0, retry_time=0, alt_func=None, **keyargs):
		super().__init__(func, when, name, repeating,
			threaded, ignore_exceptions, retrys, retry_time, alt_func)
		if isinstance(start_time, str):
			self.start_time = parse.datetime_string(start_time)
		else:
			self.start_time = start_time
		self.time_initialized = now()
Example #2
0
	def __init__(self, func, when, interval, *argums, name=None, repeating=True, threaded=True,
			ignore_exceptions=False, retrys=0, retry_time=0, alt_func=None, custom_format=None, **keyargs):
		super().__init__(func, when, interval, name, repeating, threaded,
			ignore_exceptions, retrys, retry_time, alt_func, custom_format)
		self.queue = deque([parse.datetime_string(dt.rstrip(' ').lstrip(' '), custom_format) for dt in when.split(',')])
Example #3
0
	def next_run_time(self):
		"""
		Returns the next run time based on the set datetime and interval
		"""
		if not self.is_paused():
			return self.increment(parse.datetime_string(self.when, self.custom_format))