Ʋa dZeZgdZ ddlmZddlZddlm Z dZ dZ dZ d Z d Zd Zd Zd ZdZdZdZdZdZdZee e e e ee eZeeeeeeeeZdZdZdZdZy#e$r ddlmZY^wxYw)zLaunchpad-specific URIs and convenience lookup functions. The code in this module lets users say "staging" when they mean "https://api.staging.launchpad.net/". )lookup_service_rootlookup_web_rootweb_root_for_service_root)urlparseN)URIzhttps://api.launchpad.net/z$https://api.qastaging.launchpad.net/z"https://api.staging.launchpad.net/zhttps://api.launchpad.test/zhttps://api.dogfood.paddev.net/zhttp://api.launchpad.test:8085/zhttps://launchpad.net/z https://qastaging.launchpad.net/zhttps://staging.launchpad.net/zhttps://launchpad.test/zhttps://dogfood.paddev.net/zhttp://launchpad.test:8085/zhttps://api.edge.launchpad.net/zhttps://edge.launchpad.net/) productionedge qastagingstagingdogfooddevtest_devc|dk(rtjdt||vr||St|\}}}}}}|dk7r|dk7r|St d|z)z3Dereference what might a URL or an alias for a URL.r zCLaunchpad edge server no longer exists. Using 'production' instead.z:%s is not a valid URL or an alias for any Launchpad server)warningswarnDeprecationWarningr ValueError)rootaliasesschemenetlocpath parametersqueryfragments 3/usr/lib/python3/dist-packages/launchpadlib/uris.py_dereference_aliasrOst v~ .    wt};C4.7VVT:uh |"   G$N c8|tk(rd}t|tS)zDereference 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 )EDGE_SERVICE_ROOTr service_roots) service_roots rrrgs(( lM ::rc8|tk(rd}t|tS)zDereference 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 ) EDGE_WEB_ROOTr web_roots)web_roots rrrts=  h 22rct|}t|}d|_|jj ddd|_t |j }|S)zeTurn a service root URL into a web root URL. This is done heuristically, not with a lookup. rzapi.)rrrhostreplacestr ensureSlash)r# web_root_urir's rrrsU '|4L|$LL$))11&"a@L<++-.H Or)__doc__type __metaclass____all__ urllib.parser ImportErrorrlazr.urirLPNET_SERVICE_ROOTQASTAGING_SERVICE_ROOTSTAGING_SERVICE_ROOTDEV_SERVICE_ROOTDOGFOOD_SERVICE_ROOTTEST_DEV_SERVICE_ROOTLPNET_WEB_ROOTQASTAGING_WEB_ROOTSTAGING_WEB_ROOT DEV_WEB_ROOTDOGFOOD_WEB_ROOTTEST_DEV_WEB_ROOTr!r%dictr"r&rrrrrrrDs"    "%1?;089)73( 01 6- ! $  "        0 ; 3 E"!"sA!! A/.A/