Show More
@@ -37,7 +37,7 b' from IPython.core.profiledir import ProfileDir, ProfileDirError' | |||||
37 |
|
37 | |||
38 | from IPython.utils.capture import RichOutput |
|
38 | from IPython.utils.capture import RichOutput | |
39 | from IPython.utils.coloransi import TermColors |
|
39 | from IPython.utils.coloransi import TermColors | |
40 | from IPython.utils.jsonutil import rekey |
|
40 | from IPython.utils.jsonutil import rekey, extract_dates | |
41 | from IPython.utils.localinterfaces import localhost, is_local_ip |
|
41 | from IPython.utils.localinterfaces import localhost, is_local_ip | |
42 | from IPython.utils.path import get_ipython_dir |
|
42 | from IPython.utils.path import get_ipython_dir | |
43 | from IPython.utils.py3compat import cast_bytes, string_types, xrange, iteritems |
|
43 | from IPython.utils.py3compat import cast_bytes, string_types, xrange, iteritems | |
@@ -675,7 +675,7 b' class Client(HasTraits):' | |||||
675 | if 'date' in parent: |
|
675 | if 'date' in parent: | |
676 | md['submitted'] = parent['date'] |
|
676 | md['submitted'] = parent['date'] | |
677 | if 'started' in msg_meta: |
|
677 | if 'started' in msg_meta: | |
678 | md['started'] = msg_meta['started'] |
|
678 | md['started'] = extract_dates(msg_meta['started']) | |
679 | if 'date' in header: |
|
679 | if 'date' in header: | |
680 | md['completed'] = header['date'] |
|
680 | md['completed'] = header['date'] | |
681 | return md |
|
681 | return md | |
@@ -1564,8 +1564,8 b' class Client(HasTraits):' | |||||
1564 | for msg_id in sorted(theids): |
|
1564 | for msg_id in sorted(theids): | |
1565 | if msg_id in content['completed']: |
|
1565 | if msg_id in content['completed']: | |
1566 | rec = content[msg_id] |
|
1566 | rec = content[msg_id] | |
1567 | parent = rec['header'] |
|
1567 | parent = extract_dates(rec['header']) | |
1568 | header = rec['result_header'] |
|
1568 | header = extract_dates(rec['result_header']) | |
1569 | rcontent = rec['result_content'] |
|
1569 | rcontent = rec['result_content'] | |
1570 | iodict = rec['io'] |
|
1570 | iodict = rec['io'] | |
1571 | if isinstance(rcontent, str): |
|
1571 | if isinstance(rcontent, str): | |
@@ -1580,7 +1580,7 b' class Client(HasTraits):' | |||||
1580 | ) |
|
1580 | ) | |
1581 | md.update(self._extract_metadata(md_msg)) |
|
1581 | md.update(self._extract_metadata(md_msg)) | |
1582 | if rec.get('received'): |
|
1582 | if rec.get('received'): | |
1583 | md['received'] = rec['received'] |
|
1583 | md['received'] = extract_dates(rec['received']) | |
1584 | md.update(iodict) |
|
1584 | md.update(iodict) | |
1585 |
|
1585 | |||
1586 | if rcontent['status'] == 'ok': |
|
1586 | if rcontent['status'] == 'ok': | |
@@ -1842,6 +1842,13 b' class Client(HasTraits):' | |||||
1842 | has_bufs = buffer_lens is not None |
|
1842 | has_bufs = buffer_lens is not None | |
1843 | has_rbufs = result_buffer_lens is not None |
|
1843 | has_rbufs = result_buffer_lens is not None | |
1844 | for i,rec in enumerate(records): |
|
1844 | for i,rec in enumerate(records): | |
|
1845 | # unpack datetime objects | |||
|
1846 | for dtkey in ('header', 'result_header', | |||
|
1847 | 'submitted', 'started', | |||
|
1848 | 'completed', 'received', | |||
|
1849 | ): | |||
|
1850 | if dtkey in rec: | |||
|
1851 | rec[dtkey] = extract_dates(rec[dtkey]) | |||
1845 | # relink buffers |
|
1852 | # relink buffers | |
1846 | if has_bufs: |
|
1853 | if has_bufs: | |
1847 | blen = buffer_lens[i] |
|
1854 | blen = buffer_lens[i] |
@@ -30,6 +30,7 b' from zmq.eventloop.zmqstream import ZMQStream' | |||||
30 |
|
30 | |||
31 | # internal: |
|
31 | # internal: | |
32 | from IPython.utils.importstring import import_item |
|
32 | from IPython.utils.importstring import import_item | |
|
33 | from IPython.utils.jsonutil import extract_dates | |||
33 | from IPython.utils.localinterfaces import localhost |
|
34 | from IPython.utils.localinterfaces import localhost | |
34 | from IPython.utils.py3compat import cast_bytes, unicode_type, iteritems |
|
35 | from IPython.utils.py3compat import cast_bytes, unicode_type, iteritems | |
35 | from IPython.utils.traitlets import ( |
|
36 | from IPython.utils.traitlets import ( | |
@@ -1385,7 +1386,7 b' class Hub(SessionFactory):' | |||||
1385 | def db_query(self, client_id, msg): |
|
1386 | def db_query(self, client_id, msg): | |
1386 | """Perform a raw query on the task record database.""" |
|
1387 | """Perform a raw query on the task record database.""" | |
1387 | content = msg['content'] |
|
1388 | content = msg['content'] | |
1388 | query = content.get('query', {}) |
|
1389 | query = extract_dates(content.get('query', {})) | |
1389 | keys = content.get('keys', None) |
|
1390 | keys = content.get('keys', None) | |
1390 | buffers = [] |
|
1391 | buffers = [] | |
1391 | empty = list() |
|
1392 | empty = list() |
General Comments 0
You need to be logged in to leave comments.
Login now