From bc91dfe2a273bb319e011ebfdbcc323243ed5814 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Mon, 19 Aug 2019 14:20:37 -0500 Subject: [PATCH] updated croniter to match libraryautoupdate (newest) --- resources/lib/croniter.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/resources/lib/croniter.py b/resources/lib/croniter.py index dca0441..76a4c90 100644 --- a/resources/lib/croniter.py +++ b/resources/lib/croniter.py @@ -4,7 +4,7 @@ import re from time import time, mktime from datetime import datetime, date -from relativedelta import relativedelta +from .relativedelta import relativedelta search_re = re.compile(r'^([^-]+)-([^-/]+)(/(.*))?$') only_int_re = re.compile(r'^\d+$') @@ -85,7 +85,7 @@ class croniter(object): or not only_int_re.search(str(step))): raise ValueError("[%s] is not acceptable" %expr_format) - for j in xrange(int(low), int(high)+1): + for j in range(int(low), int(high)+1): if j % int(step) == 0: e_list.append(j) else: @@ -298,11 +298,4 @@ class croniter(object): if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0): return True else: - return False - -if __name__ == '__main__': - - base = datetime(2010, 1, 25) - itr = croniter('0 0 1 * *', base) - n1 = itr.get_next(datetime) - print n1 + return False \ No newline at end of file