Skip to content

Commit

Permalink
Add support to dump '#inst' with microseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
hcarvalhoalves committed Jul 3, 2015
1 parent f25e88b commit ab44d6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion edn_format/edn_dump.py
Expand Up @@ -73,7 +73,7 @@ def udump(obj, string_encoding = DEFAULT_INPUT_ENCODING):
return '{{{}}}'.format(seq(itertools.chain.from_iterable(obj.items()),
string_encoding))
elif isinstance(obj, datetime.datetime):
return '#inst "{}"'.format(pyrfc3339.generate(obj))
return '#inst "{}"'.format(pyrfc3339.generate(obj, microseconds=True))
elif isinstance(obj, datetime.date):
return '#inst "{}"'.format(obj.isoformat())
elif isinstance(obj, uuid.UUID):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -5,7 +5,7 @@
from distutils.core import setup

setup(name="edn_format",
version="0.5.8",
version="0.5.9",
author="Swaroop C H",
author_email="swaroop@swaroopch.com",
description="EDN format reader and writer in Python",
Expand Down
2 changes: 1 addition & 1 deletion tests.py
Expand Up @@ -204,7 +204,7 @@ def test_round_trip_same(self):
'[1 "abc" true :ghi]',
'(1 "abc" true :ghi)',
'{"a" 2}',
'#inst "1985-04-12T23:20:50Z"',
'#inst "1985-04-12T23:20:50.000000Z"',
'#inst "2011-10-09"',
'#uuid "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"',
'#date "19/07/1984"',
Expand Down

0 comments on commit ab44d6f

Please sign in to comment.