
    h                     @    d dl mZmZmZ ddlmZ  G d d          ZdS )    )OptionalAnyTextIO   )SSAFilec                       e Zd ZdZedddedededdf
d	            Zedddedededdf
d
            Z	edede
e         fd            ZdS )
FormatBasea  
    Base class for subtitle format implementations.

    How to implement a new subtitle format:

    1. Create a subclass of FormatBase and override the methods you want to support.
    2. Decide on a format identifier, like the ``"srt"`` or ``"microdvd"`` already used in the library.
    3. Add your identifier and class to :data:`pysubs2.formats.FORMAT_IDENTIFIER_TO_FORMAT_CLASS`.
    4. (optional) Add your file extension and class to :data:`pysubs2.formats.FILE_EXTENSION_TO_FORMAT_IDENTIFIER`.

    After finishing these steps, you can call :meth:`SSAFile.load()` and :meth:`SSAFile.save()` with your
    format, including autodetection from content and file extension (if you provided these).

    subsr   fpformat_kwargsreturnNc                      t          d          )az  
        Load subtitle file into an empty SSAFile.

        If the parser autodetects framerate, set it as ``subs.fps``.

        Arguments:
            subs (SSAFile): An empty :class:`SSAFile`.
            fp (file object): Text file object, the subtitle file.
            format_ (str): Format identifier. Used when one format class
                implements multiple formats (see :class:`SubstationFormat`).
            kwargs: Extra options, eg. `fps`.

        Returns:
            None

        Raises:
            pysubs2.exceptions.UnknownFPSError: Framerate was not provided and cannot
                be detected.
        z(Parsing is not supported for this formatNotImplementedErrorclsr
   r   r   r   s        T/var/www/html/auto_sub_bot/venv/lib/python3.11/site-packages/pysubs2/formats/base.py	from_filezFormatBase.from_file   s    * ""LMMM    c                      t          d          )a  
        Write SSAFile into a file.

        If you need framerate and it is not passed in keyword arguments,
        use ``subs.fps``.

        Arguments:
            subs (SSAFile): Subtitle file to write.
            fp (file object): Text file object used as output.
            format_ (str): Format identifier of desired output format.
                Used when one format class implements multiple formats
                (see :class:`SubstationFormat`).
            kwargs: Extra options, eg. `fps`.

        Returns:
            None

        Raises:
            pysubs2.exceptions.UnknownFPSError: Framerate was not provided and
                ``subs.fps is None``.
        z(Writing is not supported for this formatr   r   s        r   to_filezFormatBase.to_file+   s    . ""LMMMr   textc                     dS )aC  
        Return format identifier of recognized format, or None.

        Arguments:
            text (str): Content of subtitle file. When the file is long,
                this may be only its first few thousand characters.

        Returns:
            format identifier (eg. ``"srt"``) or None (unknown format)
        N )r   r   s     r   guess_formatzFormatBase.guess_formatD   s	     tr   )__name__
__module____qualname____doc__classmethodr   strr   r   r   r   r   r   r   r   r	   r	      s          NY NF NS NC NTX N N N [N, N9 N& N3 N# NRV N N N [N0      [  r   r	   N)typingr   r   r   ssafiler   r	   r   r   r   <module>r%      sq    ( ( ( ( ( ( ( ( ( (      K K K K K K K K K Kr   