§
    Â&=d…  ã                   ó^   — d dl mZ ddlmZ ddlmZ d dlmZ dZ G d„ de¦  «        Z	dd
„Z
d	S )é    )Ú
HTMLParseré   )Úutils)Úopen_url)Ú	NoNetworkz2https://buildd.debian.org/build.php?arch=%s&pkg=%sc                   ó4   — e Zd Zd„ Zd„ Zd„ Zd	d„Zd„ Zd„ ZdS )
ÚBuilddParserc                 óX   — t          j        | ¦  «         i | _        d | _        d| _        d S )NF)r   Ú__init__ÚversionsÚsavedataÚfound_succeeded©Úselfs    ú7/usr/lib/python3/dist-packages/reportbug/checkbuildd.pyr   zBuilddParser.__init__%   s/   € ÝÔ˜DÑ!Ô!Ð!ØˆŒØˆŒØ$ˆÔÐÐó    c                 ó6   — | j         �| j         |z   | _         d S d S )N©r   )r   Údatas     r   Úhandle_datazBuilddParser.handle_data.   s$   € ØŒ=Ð$Ø œM¨DÑ0ˆDŒMˆMˆMð %Ð$r   c                 ó   — d| _         d S )NÚ r   r   s    r   Úsave_bgnzBuilddParser.save_bgn3   s   € ØˆŒˆˆr   r   c                 óx   — | j         }d | _         |s)|�'d                     |                     ¦   «         ¦  «        }|S )Nú )r   ÚjoinÚsplit)r   Úmoder   s      r   Úsave_endzBuilddParser.save_end6   s;   € ØŒ}ˆØˆŒØð 	*˜Ð(Ø—8’8˜DŸJšJ™LœLÑ)Ô)ˆDØˆr   c                 ó>   — |dk    r|                       ¦   «          d S d S )NÚtd)r   )r   ÚtagÚattrss      r   Úhandle_starttagzBuilddParser.handle_starttag=   s#   € Ø�$Š;ˆ;Ø�MŠM‰OŒOˆOˆOˆOð ˆ;r   c                 ó„   — |dk    r5|                       ¦   «         }|r!d|                     ¦   «         v rd| _        d S d S d S d S )Nr!   Ú
successfulT)r   Úlowerr   )r   r"   r   s      r   Úhandle_endtagzBuilddParser.handle_endtagA   sW   € Ø�$Š;ˆ;Ø—=’=‘?”?ˆDØð ,˜¨¯
ª
©¬Ð4Ð4Ø'+�Ô$Ð$Ð$ð ˆ;ð,ð ,Ð4Ð4r   N)r   )	Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r$   r(   © r   r   r	   r	   $   ss   € € € € € ð%ð %ð %ð1ð 1ð 1ð
ð ð ðð ð ð ðð ð ð,ð ,ð ,ð ,ð ,r   r	   Nc                 óä   — |st          j        ¦   «         }	 t          t          || fz  ||¦  «        }n# t          $ r Y dS w xY w|sdS t          ¦   «         }|                     |¦  «         |j        S )a  
    Check if a source package was built successfully on a buildd

    The check is not about a specific package version. If `arch` is not
    given and there is evidence that any version of the package once
    built sucessfully on any architecture, this function returns True.

    If `arch` is given, the check is restricted to that architecture.

    Parameters
    ----------
    src_package : str
        name of a source package
    timeout : int
        connection timeout in seconds
    arch : str, optional
        the arch to be checked
    http_proxy : str, optional
        Http proxy url to use for connection

    Returns
    -------
    bool
        True if the connection succeeded and the package was found to
        have built successfully, otherwise False
    F)r   Úget_archr   Ú
BUILDD_URLr   r	   Úfeedr   )Úsrc_packageÚtimeoutÚarchÚ
http_proxyÚpageÚparsers         r   Úcheck_builtr7   H   s�   € ð6 ð  ÝŒ~ÑÔˆðÝ�
 d¨KÐ%8Ñ8¸*ÀgÑNÔNˆˆøÝð ð ð Øˆuˆuðøøøð ð Øˆuå‰^Œ^€FØ
‡K‚K�ÑÔÐàÔ!Ð!s   —3 ³
AÁ A)NN)Úhtml.parserr   r   r   Úurlutilsr   Úreportbug.exceptionsr   r/   r	   r7   r,   r   r   ú<module>r;      s¬   ðð0 #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð B€
ð!,ð !,ð !,ð !,ð !,�:ñ !,ô !,ð !,ðH)"ð )"ð )"ð )"ð )"ð )"r   