configparser: Replace days with timeinterval

This commit is contained in:
Chad Birch
2013-07-04 00:01:09 -06:00
parent 840ab37de3
commit d48e260b3d

View File

@@ -20,9 +20,10 @@
# Inc. All Rights Reserved.
###############################################################################
import datetime
import re
from r2.lib.utils import timeinterval_fromstr
class ConfigValue(object):
_bool_map = dict(true=True, false=False)
@@ -71,8 +72,8 @@ class ConfigValue(object):
return (x.strip() for x in v.split(delim) if x)
@staticmethod
def days(v, key=None, data=None):
return datetime.timedelta(int(v))
def timeinterval(v, key=None, data=None):
return timeinterval_fromstr(v)
messages_re = re.compile(r'"([^"]+)"')
@staticmethod