platypush/plugins/media/subtitles/__init__.py
def to_vtt(self, filename):
        """
        Get the VTT content given an SRT file. Will return the original content if
        the file is already in VTT format.
        """

        if filename.lower().endswith('.vtt'):
            return filename

        import webvtt

        with self._file_lock:
            try:
                webvtt.read(filename)
                return filename
            except Exception:
                webvtt.from_srt(filename).save()
                return '.'.join(filename.split('.')[:-1]) + '.vtt'

        Get the VTT content given an SRT file. Will return the original content if
        the file is already in VTT format.
        
Get the VTT content given an SRT file. Will return the original content if
the file is already in VTT format.
Get the VTT content given an SRT file . Will return the original content if the file is already in VTT format .
def to_vtt(self, filename):
        if filename.lower().endswith('.vtt'):
            return filename
        import webvtt
        with self._file_lock:
            try:
                webvtt.read(filename)
                return filename
            except Exception:
                webvtt.from_srt(filename).save()
                return '.'.join(filename.split('.')[:-1]) + '.vtt'
def to_vtt ( self , filename ) : if filename . lower ( ) . endswith ( '.vtt' ) : return filename import webvtt with self . _file_lock : try : webvtt . read ( filename ) return filename except Exception : webvtt . from_srt ( filename ) . save ( ) return '.' . join ( filename . split ( '.' ) [ : - 1 ] ) + '.vtt'
Get the VTT content given an SRT file.
Get the VTT content given an SRT file .
"""
        Get the VTT content given an SRT file. Will return the original content if
        the file is already in VTT format.
        """
self
filename