mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-15 04:45:49 +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:
|
||||||
@ -299,10 +299,3 @@ class croniter(object):
|
|||||||
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