def duration_to_text(self, duration):
        """
        Return the textual representation of the given `duration`. The duration can either be a tuple of
        :class:`datetime.time` objects, or a simple number. The returned text will be either a hhmm-hhmm string (if the
        given `duration` is a tuple) or a number.
        """
        if isinstance(duration, tuple):
            start = (duration[0].strftime(self.ENTRY_DURATION_FORMAT)
                     if duration[0] is not None
                     else '')

            end = (duration[1].strftime(self.ENTRY_DURATION_FORMAT)
                   if duration[1] is not None
                   else '?')

            duration = '%s-%s' % (start, end)
        else:
            duration = six.text_type(duration)

        return duration
def duration_to_text ( self , duration ) : if isinstance ( duration , tuple ) : start = ( duration [ 0 ] . strftime ( self . ENTRY_DURATION_FORMAT ) if duration [ 0 ] is not None else '' ) end = ( duration [ 1 ] . strftime ( self . ENTRY_DURATION_FORMAT ) if duration [ 1 ] is not None else '?' ) duration = '%s-%s' % ( start , end ) else : duration = six . text_type ( duration ) return duration
Return the textual representation of the given `duration`. The duration can either be a tuple of
        :class:`datetime.time` objects, or a simple number. The returned text will be either a hhmm-hhmm string (if the
        given `duration` is a tuple) or a number.