Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/launchpadlib/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/launchpadlib/uris.pyc


Nc@s)dZeZdddgZddlmZddlZddlmZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZededede	de
dedede
ZedededededededeZdZdZdZd ZdS(!sLaunchpad-specific URIs and convenience lookup functions.

The code in this module lets users say "staging" when they mean
"https://api.staging.launchpad.net/".
tlookup_service_roottlookup_web_roottweb_root_for_service_rooti(turlparseN(tURIshttps://api.launchpad.net/s$https://api.qastaging.launchpad.net/s"https://api.staging.launchpad.net/shttps://api.launchpad.dev/s"https://api.dogfood.launchpad.net/shttp://api.launchpad.dev:8085/shttps://launchpad.net/s https://qastaging.launchpad.net/shttps://staging.launchpad.net/shttps://launchpad.dev/shttps://dogfood.launchpad.net/shttp://launchpad.dev:8085/shttps://api.edge.launchpad.net/shttps://edge.launchpad.net/t
productiontedget	qastagingtstagingtdogfoodtdevttest_devcCs|dkrtjdtn||kr3||St|\}}}}}}|dkrm|dkrm|Std|dS(s3Dereference what might a URL or an alias for a URL.RsCLaunchpad edge server no longer exists. Using 'production' instead.ts:%s is not a valid URL or an alias for any Launchpad serverN(twarningstwarntDeprecationWarningRt
ValueError(troottaliasestschemetnetloctpatht
parameterstquerytfragment((s5/usr/lib/python2.7/dist-packages/launchpadlib/uris.pyt_dereference_aliasLs	
cCs"|tkrd}nt|tS(sDereference an alias to a service root.

    A recognized server alias such as "staging" gets turned into the
    appropriate URI. A URI gets returned as is. Any other string raises a
    ValueError.
    R(tEDGE_SERVICE_ROOTRt
service_roots(tservice_root((s5/usr/lib/python2.7/dist-packages/launchpadlib/uris.pyR^s	cCs"|tkrd}nt|tS(sDereference an alias to a website root.

    A recognized server alias such as "staging" gets turned into the
    appropriate URI. A URI gets returned as is. Any other string raises a
    ValueError.
    R(t
EDGE_WEB_ROOTRt	web_roots(tweb_root((s5/usr/lib/python2.7/dist-packages/launchpadlib/uris.pyRks	cCsRt|}t|}d|_|jjddd|_t|j}|S(seTurn a service root URL into a web root URL.

    This is done heuristically, not with a lookup.
    Rsapi.i(RRRthosttreplacetstrtensureSlash(Rtweb_root_uriR((s5/usr/lib/python2.7/dist-packages/launchpadlib/uris.pyRxs	(t__doc__ttypet
__metaclass__t__all__RR
tlazr.uriRtLPNET_SERVICE_ROOTtQASTAGING_SERVICE_ROOTtSTAGING_SERVICE_ROOTtDEV_SERVICE_ROOTtDOGFOOD_SERVICE_ROOTtTEST_DEV_SERVICE_ROOTtLPNET_WEB_ROOTtQASTAGING_WEB_ROOTtSTAGING_WEB_ROOTtDEV_WEB_ROOTtDOGFOOD_WEB_ROOTtTEST_DEV_WEB_ROOTRRtdictRRRRRR(((s5/usr/lib/python2.7/dist-packages/launchpadlib/uris.pyt<module>sR