def _format_value(self, value): # Format timedelta as HH:MM:SS if isinstance(value, timedelta): return seconds_humanize(value.total_seconds()) return value
def total_time(t, short=False): ''' Display total time as a nicely formatted string from a timestamp or timedelta ''' if isinstance(t, timedelta): t = t.total_seconds() return seconds_humanize(t, short)
def total_time(t, short=False): """ Display total time as a nicely formatted string from a timestamp or timedelta """ if isinstance(t, timedelta): t = t.total_seconds() return seconds_humanize(t, short)
def convert_speed(s): ''' Convert a speed in m/s to a nicer time display in min/km ''' return s > 0 and seconds_humanize(1000.0 / s, True) or 0
def convert_speed(s): """ Convert a speed in m/s to a nicer time display in min/km """ return s > 0 and seconds_humanize(1000.0 / s, True) or 0