Commit 4536b8bb authored by Jason Frisvold's avatar Jason Frisvold
Browse files

- regex strings should be raw strings (python 3)

parent 75e3f261
......@@ -135,7 +135,7 @@ class SkynetTimer(object):
@minute.setter
def minute(self, value):
# * or [0-59] or [0-59],[0-59],etc
matches = re.match('^(\*|[0-5]?[0-9](?:,[0-5]?[0-9])*)$',
matches = re.match(r'^(\*|[0-5]?[0-9](?:,[0-5]?[0-9])*)$',
value)
if (matches):
if (matches.group() == '*'):
......@@ -144,8 +144,8 @@ class SkynetTimer(object):
self._minute = value.split(',')
else:
# [0-59]-[0-59]/[1-60] or */[1-60]
matches = re.match('^((([0-5]?[0-9])\-([0-5]?[0-9])|\*)'
'\/([1-9]|[1-5][0-9]|60))$',
matches = re.match(r'^((([0-5]?[0-9])\-([0-5]?[0-9])|\*)'
r'\/([1-9]|[1-5][0-9]|60))$',
value)
if (matches):
if (matches.group(2) == '*'):
......@@ -173,8 +173,8 @@ class SkynetTimer(object):
@hour.setter
def hour(self, value):
# * or [0-23] or [0-23],[0-23],etc
matches = re.match('^(\*|(?:[01]?[0-9]|2[0-3])'
'(?:,(?:[01]?[0-9]|2[0-3]))*)$',
matches = re.match(r'^(\*|(?:[01]?[0-9]|2[0-3])'
r'(?:,(?:[01]?[0-9]|2[0-3]))*)$',
value)
if (matches):
if (matches.group() == '*'):
......@@ -183,9 +183,9 @@ class SkynetTimer(object):
self._hour = value.split(',')
else:
# [0-23]-[0-23]/[1-24] or */[1-24]
matches = re.match('^((([01]?[0-9]|2[0-3])\-'
'([01]?[0-9]|2[0-3])|\*)'
'\/([1-9]|1[0-9]|2[0-4]))$',
matches = re.match(r'^((([01]?[0-9]|2[0-3])\-'
r'([01]?[0-9]|2[0-3])|\*)'
r'\/([1-9]|1[0-9]|2[0-4]))$',
value)
if (matches):
if (matches.group(2) == '*'):
......@@ -213,8 +213,8 @@ class SkynetTimer(object):
@day.setter
def day(self, value):
# * or [1-31] or [1-31],[1-31],etc
matches = re.match('^(\*|(?:[1-9]|[1-2][0-9]|3[01])'
'(?:,(?:[1-9]|[1-2][0-9]|3[01]))*)$',
matches = re.match(r'^(\*|(?:[1-9]|[1-2][0-9]|3[01])'
r'(?:,(?:[1-9]|[1-2][0-9]|3[01]))*)$',
value)
if (matches):
if (matches.group() == '*'):
......@@ -223,9 +223,9 @@ class SkynetTimer(object):
self._day = value.split(',')
else:
# [1-31]-[1-31]/[1-31] or */[1-31]
matches = re.match('^((([1-9]|[1-2][0-9]|3[01])\-'
'([1-9]|[1-2][0-9]|3[01])|\*)'
'\/([1-9]|[1-2][0-9]|3[01]))$',
matches = re.match(r'^((([1-9]|[1-2][0-9]|3[01])\-'
r'([1-9]|[1-2][0-9]|3[01])|\*)'
r'\/([1-9]|[1-2][0-9]|3[01]))$',
value)
if (matches):
if (matches.group(2) == '*'):
......@@ -253,7 +253,7 @@ class SkynetTimer(object):
@month.setter
def month(self, value):
# * or [1-12] or [1-12],[1-12],etc
matches = re.match('^(\*|(?:[1-9]|1[0-2])(?:,(?:[1-9]|1[0-2]))*)$',
matches = re.match(r'^(\*|(?:[1-9]|1[0-2])(?:,(?:[1-9]|1[0-2]))*)$',
value)
if (matches):
if (matches.group() == '*'):
......@@ -262,8 +262,8 @@ class SkynetTimer(object):
self._month = value.split(',')
else:
# [1-12]-[1-12]/[1-12] or */[1-12]
matches = re.match('^((([1-9]|1[0-2])\-([1-9]|1[0-2])|\*)'
'\/([1-9]|1[0-2]))$',
matches = re.match(r'^((([1-9]|1[0-2])\-([1-9]|1[0-2])|\*)'
r'\/([1-9]|1[0-2]))$',
value)
if (matches):
if (matches.group(2) == '*'):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment