big change n parsing logic passing
This commit is contained in:
parent
ca06237c3c
commit
56906b9ebc
17 changed files with 570 additions and 127 deletions
|
|
@ -69,26 +69,5 @@ class DatePeriod(Period):
|
|||
return scheduler.add_date_job(func, self.date, jobInfo)
|
||||
|
||||
|
||||
def parsePeriodList(periodlist, log):
|
||||
periods = []
|
||||
#log.d("values of periodslist: " + str(periodlist.items()))
|
||||
for name, values in periodlist.items():
|
||||
|
||||
if "date" in values:
|
||||
periods.append(DatePeriod(name, **values))
|
||||
continue
|
||||
|
||||
comp = ["weeks", "days", "hours", "minutes", "seconds", "start_date"]
|
||||
if len([i for i in comp if i in values]) > 0 :
|
||||
periods.append(IntervalPeriod(name, **values))
|
||||
break
|
||||
|
||||
comp = ["year", "month", "day", "week", "day_of_week", "hour", "minute", "second"]
|
||||
if len([i for i in comp if i in values]) > 0 :
|
||||
periods.append(CronPeriod(name, **values))
|
||||
break
|
||||
else:
|
||||
log.w("ignoring Period: " + str(name))
|
||||
log.w("reason: could not determine PeriodType: " + str(values))
|
||||
|
||||
return periods
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue