Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_range(self, *vrange):
"""Return a cron range for this slice"""
ret = CronRange(self, *vrange)
if ret.dangling is not None:
return [ret.dangling, ret]
return [ret]
def __iter__(self):
"""Return the entire element as an iterable"""
ret = {}
# An empty part means '*' which is every(1)
if not self.parts:
self.every(1)
for part in self.parts:
if isinstance(part, CronRange):
for bit in part.range():
ret[bit] = 1
else:
ret[int(part)] = 1
for val in ret:
yield val