
    khs                     N    d dl Z ddlmZ ddlmZ  e j
                         ZddZy)    N   )	HTTPError)json2packagec                 t   |j                  d      s|dz   }t        j                  dj                  ||             }|j                  dk\  r!t        |j                  |j                        t        |j                  d      r#t        |j                  j                               S t        |j                        S )aO  
    Construct a request to the PyPI server and returns an instance of
    :class:`yarg.package.Package`.

    :param package_name: case sensitive name of the package on the PyPI server.
    :param pypi_server: (option) URL to the PyPI server.

        >>> import yarg
        >>> package = yarg.get('yarg')
        <Package yarg>
    /z{0}{1}/jsoni,  )status_codereasondecode)endswithsessiongetformatr   r   r	   hasattrcontentr   r
   )package_namepypi_serverresponses      G/var/www/teggl/fontify/venv/lib/python3.12/site-packages/yarg/client.pyr   r   #   s     $!C'{{=//0<> ?Hs"H$8$8'0 	0x*H,,33566H,,--    )zhttps://pypi.python.org/pypi/)requests
exceptionsr   packager   Sessionr   r    r   r   <module>r      s'   4  ! ! (


.r   