From 635c06bb46b5e6a3f53f48167a06576c63f8aa5f Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 10 Oct 2008 19:57:34 +0000 Subject: DEV-22018 : cllsd unit test failures. Fixed mostly by changing the Python code and the tests to look more like cllsd. --- indra/lib/python/indra/base/llsd.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/indra/lib/python/indra/base/llsd.py b/indra/lib/python/indra/base/llsd.py index 17ab89004a..5b8f5d7613 100644 --- a/indra/lib/python/indra/base/llsd.py +++ b/indra/lib/python/indra/base/llsd.py @@ -47,7 +47,7 @@ alpha_regex = re.compile(r"[a-zA-Z]+") date_regex = re.compile(r"(?P\d{4})-(?P\d{2})-(?P\d{2})T" r"(?P\d{2}):(?P\d{2}):(?P\d{2})" r"(?P(\.\d+)?)Z") -#date: d"YYYY-MM-DDTHH:MM:SS.FFZ" +#date: d"YYYY-MM-DDTHH:MM:SS.FFFFFFZ" class LLSDParseError(Exception): pass @@ -69,14 +69,7 @@ BOOL_FALSE = ('0', '0.0', 'false', '') def format_datestr(v): """ Formats a datetime object into the string format shared by xml and notation serializations.""" - second_str = "" - if v.microsecond > 0: - seconds = v.second + float(v.microsecond) / 1e6 - second_str = "%05.2f" % seconds - else: - second_str = "%02d" % v.second - return '%s%sZ' % (v.strftime('%Y-%m-%dT%H:%M:'), second_str) - + return v.isoformat() + 'Z' def parse_datestr(datestr): """Parses a datetime object from the string format shared by xml and notation serializations.""" -- cgit v1.2.3