ó
Ð²Ebc           @  s  d  Z  d d l m Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m	 Z	 d d l m
 Z
 d d l m Z y d d	 l m Z Wn# e k
 r¿ d Z d Z d Z n Xd d l Z d d l Z d
 „  Z d „  Z d „  Z e d k r	e ƒ  n  d S(   s'   Module containing bug report helper(s).iÿÿÿÿ(   t   print_functionN(   t   idna(   t   urllib3(   t   chardeti   (   t   __version__(   t	   pyopensslc          C  sÙ   t  j ƒ  }  |  d k r' t  j ƒ  } n  |  d k r‹ d t j j t j j t j j f } t j j d k rÇ d j	 | t j j g ƒ } qÇ n< |  d k r¦ t  j ƒ  } n! |  d k rÁ t  j ƒ  } n d } i |  d	 6| d
 6S(   s×  Return a dict with the Python implementation and version.

    Provide both the name and the version of the Python implementation
    currently running. For example, on CPython 2.7.5 it will return
    {'name': 'CPython', 'version': '2.7.5'}.

    This function works best on CPython and PyPy: in particular, it probably
    doesn't work for Jython or IronPython. Future investigation should be done
    to work out the correct shape of the code for those platforms.
    t   CPythont   PyPys   %s.%s.%st   finalt    t   Jythont
   IronPythont   Unknownt   namet   version(
   t   platformt   python_implementationt   python_versiont   syst   pypy_version_infot   majort   minort   microt   releaselevelt   join(   t   implementationt   implementation_version(    (    s6   /tmp/pip-build-UPPWic/pip/pip/_vendor/requests/help.pyt   _implementation   s     	c    	      C  sh  y$ i t  j ƒ  d 6t  j ƒ  d 6}  Wn% t k
 rK i d d 6d d 6}  n Xt ƒ  } i t j d 6} i t j d 6} i d d 6d d 6} t	 r³ i t	 j d 6d t	 j
 j d 6} n  i t t d d ƒ d 6} i t t d d ƒ d 6} t j } i | d k	 rd | n d d 6} i
 |  d	 6| d
 6| d 6t d k	 d 6| d 6| d 6| d 6| d 6| d 6i t d 6d 6S(   s&   Generate information for a bug report.t   systemt   releaseR   R   R	   t   openssl_versions   %xR   R   R   t
   system_sslt   using_pyopensslt	   pyOpenSSLR   R   t   cryptographyR   t   requestsN(   R   R   R   t   IOErrorR   R   R   R   t   Nonet   OpenSSLt   SSLt   OPENSSL_VERSION_NUMBERt   getattrR"   R   t   sslR   t   requests_version(	   t   platform_infot   implementation_infot   urllib3_infot   chardet_infot   pyopenssl_infot   cryptography_infot	   idna_infoR   t   system_ssl_info(    (    s6   /tmp/pip-build-UPPWic/pip/pip/_vendor/requests/help.pyt   info;   sJ    	

	 c           C  s&   t  t j t ƒ  d t d d ƒƒ d S(   s)   Pretty-print the bug information as JSON.t	   sort_keyst   indenti   N(   t   printt   jsont   dumpsR4   t   True(    (    (    s6   /tmp/pip-build-UPPWic/pip/pip/_vendor/requests/help.pyt   mainq   s    t   __main__(   t   __doc__t
   __future__R    R8   R   R   R*   t   pip._vendorR   R   R   R	   R   R+   t   pip._vendor.urllib3.contribR   t   ImportErrorR%   R&   R"   R   R4   R;   t   __name__(    (    (    s6   /tmp/pip-build-UPPWic/pip/pip/_vendor/requests/help.pyt   <module>   s,   
	!	6	