def __init__( self, start_offset=NegativeInfinity, stop_offset=Infinity, annotation=None, ): Timespan.__init__( self, start_offset=start_offset, stop_offset=stop_offset, ) self._annotation = annotation
def __init__( self, start_offset=NegativeInfinity, stop_offset=Infinity, used=False, ): if start_offset is None: start_offset = NegativeInfinity if stop_offset is None: stop_offset = Infinity Timespan.__init__( self, start_offset=start_offset, stop_offset=stop_offset, ) self._used = bool(used)
def _get_timespan(self, in_seconds=False): if len(self): timespan_ = self[0]._get_timespan(in_seconds=in_seconds) start_offset = timespan_.start_offset timespan_ = self[-1]._get_timespan(in_seconds=in_seconds) stop_offset = timespan_.stop_offset else: start_offset = Duration(0) stop_offset = Duration(0) return Timespan( start_offset=start_offset, stop_offset=stop_offset, )