mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +01:00
Fixed dateutil to use the "local" subdirectory format.
This commit is contained in:
parent
8c66ed9a3f
commit
279c00a925
@ -11,9 +11,9 @@ import datetime
|
||||
import struct
|
||||
import time
|
||||
|
||||
relativedelta = None
|
||||
parser = None
|
||||
rrule = None
|
||||
import relativedelta
|
||||
import parser
|
||||
rrule = None # XXX Where does this come from? Why isn't it here?
|
||||
|
||||
__all__ = ["tzutc", "tzoffset", "tzlocal", "tzfile",
|
||||
"tzrange", "tzstr", "tzical", "gettz"]
|
||||
@ -443,9 +443,6 @@ class tzrange(datetime.tzinfo):
|
||||
def __init__(self, stdabbr, stdoffset=None,
|
||||
dstabbr=None, dstoffset=None,
|
||||
start=None, end=None):
|
||||
global relativedelta
|
||||
if not relativedelta:
|
||||
from dateutil import relativedelta
|
||||
self._std_abbr = stdabbr
|
||||
self._dst_abbr = dstabbr
|
||||
if stdoffset is not None:
|
||||
@ -519,9 +516,6 @@ class tzrange(datetime.tzinfo):
|
||||
class tzstr(tzrange):
|
||||
|
||||
def __init__(self, s):
|
||||
global parser
|
||||
if not parser:
|
||||
from dateutil import parser
|
||||
self._s = s
|
||||
|
||||
res = parser._parsetz(s)
|
||||
@ -654,6 +648,7 @@ class _tzicalvtz(datetime.tzinfo):
|
||||
|
||||
class tzical:
|
||||
def __init__(self, fileobj):
|
||||
# XXX This should be fixed, but doesn't seem to be in our dateutil.
|
||||
global rrule
|
||||
if not rrule:
|
||||
from dateutil import rrule
|
@ -30,13 +30,13 @@
|
||||
import time
|
||||
TIME = time # For later use.
|
||||
|
||||
import dateutil.parser
|
||||
|
||||
import supybot.conf as conf
|
||||
import supybot.utils as utils
|
||||
from supybot.commands import *
|
||||
import supybot.callbacks as callbacks
|
||||
|
||||
parser = utils.python.universalImport('dateutil.parser', 'local.dateutil.parser')
|
||||
|
||||
def parse(s):
|
||||
todo = []
|
||||
s = s.replace('noon', '12:00')
|
||||
@ -47,7 +47,7 @@ def parse(s):
|
||||
if 'next week' in s:
|
||||
todo.append(lambda i: i + 86400*7)
|
||||
s = s.replace('next week', '')
|
||||
i = int(time.mktime(dateutil.parser.parse(s, fuzzy=True).timetuple()))
|
||||
i = int(time.mktime(parser.parse(s, fuzzy=True).timetuple()))
|
||||
for f in todo:
|
||||
i = f(i)
|
||||
return i
|
||||
|
Loading…
Reference in New Issue
Block a user