mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-14 20:35:48 +01:00
updated croniter to match libraryautoupdate (newest)
This commit is contained in:
parent
27fbadebda
commit
bc91dfe2a2
@ -4,7 +4,7 @@
|
|||||||
import re
|
import re
|
||||||
from time import time, mktime
|
from time import time, mktime
|
||||||
from datetime import datetime, date
|
from datetime import datetime, date
|
||||||
from relativedelta import relativedelta
|
from .relativedelta import relativedelta
|
||||||
|
|
||||||
search_re = re.compile(r'^([^-]+)-([^-/]+)(/(.*))?$')
|
search_re = re.compile(r'^([^-]+)-([^-/]+)(/(.*))?$')
|
||||||
only_int_re = re.compile(r'^\d+$')
|
only_int_re = re.compile(r'^\d+$')
|
||||||
@ -85,7 +85,7 @@ class croniter(object):
|
|||||||
or not only_int_re.search(str(step))):
|
or not only_int_re.search(str(step))):
|
||||||
raise ValueError("[%s] is not acceptable" %expr_format)
|
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:
|
if j % int(step) == 0:
|
||||||
e_list.append(j)
|
e_list.append(j)
|
||||||
else:
|
else:
|
||||||
@ -298,11 +298,4 @@ class croniter(object):
|
|||||||
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
|
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
|
|
||||||
base = datetime(2010, 1, 25)
|
|
||||||
itr = croniter('0 0 1 * *', base)
|
|
||||||
n1 = itr.get_next(datetime)
|
|
||||||
print n1
|
|
Loading…
Reference in New Issue
Block a user