mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
configparser: Replace days with timeinterval
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user