Skip to content
Snippets Groups Projects
Commit 635c06bb authored by Ryan Williams's avatar Ryan Williams
Browse files

DEV-22018 : cllsd unit test failures. Fixed mostly by changing the Python...

DEV-22018 : cllsd unit test failures.  Fixed mostly by changing the Python code and the tests to look more like cllsd.
parent 591382f6
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@
date_regex = re.compile(r"(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})T"
r"(?P<hour>\d{2}):(?P<minute>\d{2}):(?P<second>\d{2})"
r"(?P<second_float>(\.\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 @@ class uri(str):
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."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment