equal
deleted
inserted
replaced
26 |
26 |
27 import csv |
27 import csv |
28 import re |
28 import re |
29 from StringIO import StringIO |
29 from StringIO import StringIO |
30 |
30 |
31 from six import string_types |
31 from six import string_types, integer_types |
32 |
32 |
33 from logilab.mtconverter import xml_escape, html_unescape |
33 from logilab.mtconverter import xml_escape, html_unescape |
34 from logilab.common.date import ustrftime |
34 from logilab.common.date import ustrftime |
35 from logilab.common.deprecation import deprecated |
35 from logilab.common.deprecation import deprecated |
36 |
36 |
92 _('%d hours') |
92 _('%d hours') |
93 _('%d minutes') |
93 _('%d minutes') |
94 _('%d seconds') |
94 _('%d seconds') |
95 |
95 |
96 def print_timedelta(value, req, props, displaytime=True): |
96 def print_timedelta(value, req, props, displaytime=True): |
97 if isinstance(value, (int, long)): |
97 if isinstance(value, integer_types): |
98 # `date - date`, unlike `datetime - datetime` gives an int |
98 # `date - date`, unlike `datetime - datetime` gives an int |
99 # (number of days), not a timedelta |
99 # (number of days), not a timedelta |
100 # XXX should rql be fixed to return Int instead of Interval in |
100 # XXX should rql be fixed to return Int instead of Interval in |
101 # that case? that would be probably the proper fix but we |
101 # that case? that would be probably the proper fix but we |
102 # loose information on the way... |
102 # loose information on the way... |