changed error in parsing of periods

This commit is contained in:
Rafael.Timmerberg 2013-05-27 02:48:35 +02:00
commit e1025fda6c
2 changed files with 15 additions and 7 deletions

View file

@ -56,7 +56,7 @@ class CronPeriod(Period):
return ret
def createJob(self, scheduler, jobInfo, func):
return scheduler.add_cron_job(func, self.year, self.month, self.day, self.week, self.day_of_week, self.hour, self.minute, self.second,self.start_date, [jobInfo])
return scheduler.add_cron_job(func, year=self.year, month=self.month, day=self.day, week=self.week, day_of_week=self.day_of_week, hour=self.hour, minute=self.minute, second=self.second,start_date=self.start_date, args=[jobInfo])
class DatePeriod(Period):
@ -87,12 +87,12 @@ def parsePeriodList(periodlist,log):
for i in [ "weeks","days", "hours", "minutes", "seconds", "start_date"]:
if i in values:
periods.append(IntervalPeriod(name, **values))
continue
break
for i in ["year", "month", "day", "week", "day_of_week", "hour", "minute", "second"]:
if i in values:
periods.append(CronPeriod(name, **values))
continue
break
log.w("ignoring Period: " +str(name))
log.w("reason: could not determine PeriodType: " + str(values))