Your IP : 216.73.216.85


Current Path : /opt/alt/python27/lib/python2.7/site-packages/requests_toolbelt/utils/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/requests_toolbelt/utils/user_agent.pyc

�
��Wc@s1ddlZddlZdd�Zd�ZdS(i����Nc
Cs�ytj�}tj�}Wntk
r;d}d}nX|dkrQg}ntd�|D��rvtd��nd}g|D]\}}|||f^q�}|||fg|t�d||fg}	dj|	�S(s�
    Returns an internet-friendly user_agent string.

    The majority of this code has been wilfully stolen from the equivalent
    function in Requests.

    :param name: The intended name of the user-agent, e.g. "python-requests".
    :param version: The version of the user-agent, e.g. "0.0.1".
    :param extras: List of two-item tuples that are added to the user-agent
        string.
    :returns: Formatted user-agent string
    :rtype: str
    tUnknowncss!|]}t|�dkVqdS(iN(tlen(t.0textra((sS/opt/alt/python27/lib/python2.7/site-packages/requests_toolbelt/utils/user_agent.pys	<genexpr>ss/Extras should be a sequence of two item tuples.s%s/%st N(	tplatformtsystemtreleasetIOErrortNonetanyt
ValueErrort_implementation_stringtjoin(
tnametversiontextrastp_systemt	p_releaset
format_stringt
extra_namet
extra_versiontextra_piecestuser_agent_pieces((sS/opt/alt/python27/lib/python2.7/site-packages/requests_toolbelt/utils/user_agent.pyt
user_agents"

	&cCs�tj�}|dkr'tj�}n�|dkr�dtjjtjjtjjf}tjjdkr�dj	|tjjg�}q�n<|dkr�tj�}n!|dkr�tj�}nd}d	||fS(
s�
    Returns a string that provides both the name and the version of the Python
    implementation currently running. For example, on CPython 2.7.5 it will
    return "CPython/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.
    tCPythontPyPys%s.%s.%stfinalttJythont
IronPythonRs%s/%s(
Rtpython_implementationtpython_versiontsystpypy_version_infotmajortminortmicrotreleaselevelR
(timplementationtimplementation_version((sS/opt/alt/python27/lib/python2.7/site-packages/requests_toolbelt/utils/user_agent.pyR/s 
	(RR!R	RR(((sS/opt/alt/python27/lib/python2.7/site-packages/requests_toolbelt/utils/user_agent.pyt<module>s)