(self)
return '\n'.join(output)
Returns the current m3u8 as a string.
        You could also use unicode(<this obj>) or str(<this obj>)
Returns the current m3u8 as a string.
        You could also use unicode(<this obj>) or str(<this obj>)
Returns the current m3u8 as a string . You could also use unicode ( <this obj > ) or str ( <this obj > )
def dumps(self):
        '''
        Returns the current m3u8 as a string.
        You could also use unicode(<this obj>) or str(<this obj>)
        '''
        output = ['#EXTM3U']
        if self.is_independent_segments:
            output.append('#EXT-X-INDEPENDENT-SEGMENTS')
        if self.media_sequence:
            output.append('#EXT-X-MEDIA-SEQUENCE:' + str(self.media_sequence))
        if self.discontinuity_sequence:
            output.append('#EXT-X-DISCONTINUITY-SEQUENCE:{}'.format(
                number_to_string(self.discontinuity_sequence)))
        if self.allow_cache:
            output.append('#EXT-X-ALLOW-CACHE:' + self.allow_cache.upper())
        if self.version:
            output.append('#EXT-X-VERSION:' + str(self.version))
        if self.target_duration:
            output.append('#EXT-X-TARGETDURATION:' +
                          number_to_string(self.target_duration))
        if not (self.playlist_type is None or self.playlist_type == ''):
            output.append('#EXT-X-PLAYLIST-TYPE:%s' % str(self.playlist_type).upper())
        if self.start:
            output.append(str(self.start))
        if self.is_i_frames_only:
            output.append('#EXT-X-I-FRAMES-ONLY')
        if self.server_control:
            output.append(str(self.server_control))
        if self.is_variant:
            if self.media:
                output.append(str(self.media))
            output.append(str(self.playlists))
            if self.iframe_playlists:
                output.append(str(self.iframe_playlists))
        if self.part_inf:
            output.append(str(self.part_inf))
        if self.skip:
            output.append(str(self.skip))
        if self.session_data:
            output.append(str(self.session_data))

        for key in self.session_keys:
            output.append(str(key))

        output.append(str(self.segments))

        if self.preload_hint:
            output.append(str(self.preload_hint))

        if self.rendition_reports:
            output.append(str(self.rendition_reports))

        if self.is_endlist:
            output.append('#EXT-X-ENDLIST')

        # ensure that the last line is terminated correctly
        if output[-1] and not output[-1].endswith('\n'):
            output.append('')

        return '\n'.join(output)
def dumps ( self ) : output = [ '#EXTM3U' ] if self . is_independent_segments : output . append ( '#EXT-X-INDEPENDENT-SEGMENTS' ) if self . media_sequence : output . append ( '#EXT-X-MEDIA-SEQUENCE:' + str ( self . media_sequence ) ) if self . discontinuity_sequence : output . append ( '#EXT-X-DISCONTINUITY-SEQUENCE:{}' . format ( number_to_string ( self . discontinuity_sequence ) ) ) if self . allow_cache : output . append ( '#EXT-X-ALLOW-CACHE:' + self . allow_cache . upper ( ) ) if self . version : output . append ( '#EXT-X-VERSION:' + str ( self . version ) ) if self . target_duration : output . append ( '#EXT-X-TARGETDURATION:' + number_to_string ( self . target_duration ) ) if not ( self . playlist_type is None or self . playlist_type == '' ) : output . append ( '#EXT-X-PLAYLIST-TYPE:%s' % str ( self . playlist_type ) . upper ( ) ) if self . start : output . append ( str ( self . start ) ) if self . is_i_frames_only : output . append ( '#EXT-X-I-FRAMES-ONLY' ) if self . server_control : output . append ( str ( self . server_control ) ) if self . is_variant : if self . media : output . append ( str ( self . media ) ) output . append ( str ( self . playlists ) ) if self . iframe_playlists : output . append ( str ( self . iframe_playlists ) ) if self . part_inf : output . append ( str ( self . part_inf ) ) if self . skip : output . append ( str ( self . skip ) ) if self . session_data : output . append ( str ( self . session_data ) ) for key in self . session_keys : output . append ( str ( key ) ) output . append ( str ( self . segments ) ) if self . preload_hint : output . append ( str ( self . preload_hint ) ) if self . rendition_reports : output . append ( str ( self . rendition_reports ) ) if self . is_endlist : output . append ( '#EXT-X-ENDLIST' ) # ensure that the last line is terminated correctly if output [ - 1 ] and not output [ - 1 ] . endswith ( '\n' ) : output . append ( '' ) return '\n' . join ( output )