-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyc

ó
þfOc@@s[ddlmZddlZddlZddlmZmZddlZddlZddl	m
Z
mZmZm
ZddlmZdejfd„ƒYZdejfd	„ƒYZd
ejfd„ƒYZdefd
„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(i(tabsolute_importN(turlsplitt
urlunsplit(tconfigterrorsturlutilst__version__(t_urllib2_wrapperstInvalidLaunchpadInstancecB@seZdZd„ZRS(s2%(lp_instance)s is not a valid Launchpad instance.cC@stjj|d|ƒdS(Ntlp_instance(RtBzrErrort__init__(tselfR	((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR,s(t__name__t
__module__t_fmtR(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR(stNotLaunchpadBranchcB@seZdZd„ZRS(s'%(url)s is not registered on Launchpad.cC@stjj|d|ƒdS(Nturl(RR
R(RR((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR4s(R
RRR(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR0stXMLRPCTransportcB@seZd„Zdd„ZRS(cC@s5tjj|ƒ||_tjƒ|_d|_dS(Ni(t	xmlrpclibt	TransportRt_schemeRtOpenert_openertverbose(Rtscheme((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR:s	icC@sœ||_|jd||}tjd||ƒ}|jddƒ|jj|ƒ}|jdkrtj	|||j|j
|jƒƒ‚n|j|ƒS(Ns://tPOSTsContent-Typestext/xmliÈ(
RRRtRequestt
add_headerRtopentcodeRt
ProtocolErrortmsgtinfotparse_response(Rthostthandlertrequest_bodyRRtrequesttresponse((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR&@s	(R
RRR&(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR8s	tLaunchpadServicecB@sùeZdZidd6dd6dd6dd6d	d
6ZiZx(ejƒD]\ZZdeee<qHWdZeeZ	dZdZdZ
ddd„Zed
„ƒZed„ƒZd„Zd„Zd„Zed„ƒZdd„Zdd„ZRS(s‰A service to talk to Launchpad via XMLRPC.

    See http://wiki.bazaar.canonical.com/Specs/LaunchpadRpc for the methods we can call.
    s
launchpad.nett
productionsstaging.launchpad.nettstagingsqastaging.launchpad.nett	qastagingsdemo.launchpad.nettdemos
launchpad.devtdevshttps://xmlrpc.%s/bazaar/cC@s]||_|dkrPtj|jƒd}t|ƒ}dttjf|_	n||_
dS(s;Construct a new service talking to the launchpad rpc serverisbzr/%s (xmlrpclib/%s)N(t_lp_instancetNoneturllibt	splittypetservice_urlRt_bzrlib_versionRRt
user_agentt	transport(RR5R	turi_type((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRms	cC@srd}|tjkr tj|S|jdk	rgy|j|jSWqntk
rct|jƒ‚qnXn|jSdS(s~Return the http or https url for the xmlrpc server.

        This does not include the username/password credentials.
        tBZR_LP_XMLRPC_URLN(tostenvironR.R/tLAUNCHPAD_INSTANCEtKeyErrorRtDEFAULT_SERVICE_URL(Rtkey((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR2ws
cK@s_t|ƒ}|d}|dkr+d}n$||jkrOtjd|ƒ‚n|d||S(s<Return the Launchpad service corresponding to the given URL.ittpathR	N(RR/R:Rt
InvalidURL(tclsRtkwargstresultR	((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pytfor_urlˆs
	cC@sÛ|r¼t|jƒd \}}}d|kr=t|ƒ‚n|jdkrXtƒ‚n|jdkrstƒ‚ndtj|jƒtj|jƒ|f}t|||ddfƒ}n	|j}t	j
|d|jƒS(s%Return the proxy for XMLRPC requests.it@s%s:%s@%sR>R5N(RR2tAssertionErrortregistrant_emailR/tregistrant_passwordRtquoteRRtServerProxyR5(Rt
authenticatedRthostinfoR?R((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyt	get_proxy“s
	cC@s„tjƒ}|jƒ|_|jdkr€tjƒ}t|jƒd \}}d|j}|j	|||jd|ƒ|_ndS(sGet the password from the user.islaunchpad.net password for %s: tpromptN(
RtGlobalConfigt
user_emailRGRHR/tAuthenticationConfigRR2tget_password(Rt
the_configtauthRRLRN((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pytgather_user_credentials¯s
	cC@sÒ|j|ƒ}t||ƒ}y||Œ}Wntjk
rœ}|jdkrttd|jjddƒƒ‚qÎtj	d|j
|j|jfƒ‚n2tj
k
rÍ}tjd|jd|ƒ‚nX|S(Ni-s7should resend request to %s, but this isn't implementedtLocationsNO-LOCATION-PRESENTs-xmlrpc protocol error connecting to %s: %s %ssCould not resolve '%s't
orig_error(RMtgetattrRRterrcodetNotImplementedErrortheaderstgetRR
R2terrmsgtsockettgaierrortConnectionErrortdomain(Rtmethod_namet
method_paramsRKtproxytmethodRCte((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pytsend_request¾s	

cC@s/|jdkr|j}n	|j}|j|S(N(R.R/tDEFAULT_INSTANCEtLAUNCHPAD_DOMAINS(Rtinstance((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRaÖs	c
C@sìt|ƒd \}}}|dkr.t}n|dkr«||ƒ}y|j|ƒ}Wn.tjk
r‰}tj|t|ƒƒ‚nX|dd}t|ƒd}n4d„|j	j
ƒDƒ}	||	krßt|ƒ‚n|jdƒS(Nitlpturlsiics@s|]}d|VqdS(s	bazaar.%sN((t.0Ra((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pys	<genexpr>ìst/(
RR/tResolveLaunchpadPathRequesttsubmitRtFaultRR@tstrRit
itervaluesRtlstrip(
Rt
branch_urlt_request_factoryRRLR?tresolveRCtfaulttdomains((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyt_guess_branch_pathÞs 	cC@s)|j||ƒ}tjd|j|ƒS(sàGet the Launchpad web URL for the given branch URL.

        :raise errors.InvalidURL: if 'branch_url' cannot be identified as a
            Launchpad branch URL.
        :return: The URL of the branch on Launchpad.
        shttps://code.%s(RzRtjoinRa(RRuRvR?((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pytget_web_url_from_branch_urlòsN(R
Rt__doc__RiR:t	iteritemsRjRaRhR<R/R5RGRHRtpropertyR2tclassmethodRDRMRURgRzR|(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR(Os0


			tBaseRequestcB@s,eZdZdZeZd„Zd„ZRS(s,Base request for talking to a XMLRPC server.cC@st|jƒ‚dS(s*Return the arguments to pass to the methodN(RZt_request_params(R((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR‚scC@s|j|j|jƒ|jƒS(s²Submit request to Launchpad XMLRPC server.

        :param service: LaunchpadService indicating where to send
            the request and the authentication credentials.
        (Rgt_methodnameR‚t_authenticated(Rtservice((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRpsN(	R
RR}R/RƒtTrueR„R‚Rp(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRýs
	tDryRunLaunchpadServicecB@s eZdZd„Zd„ZRS(swService that just absorbs requests without sending to server.

    The dummy service does not need authentication.
    cC@sdS(N((RRbRcRK((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRgscC@sdS(N((R((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRUs(R
RR}RgRU(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR‡s	tBranchRegistrationRequestcB@s>eZdZdZdddddd„Zd„Zd„ZRS(s-Request to tell Launchpad about a bzr branch.tregister_branchR>cC@ss|stj|dƒ‚n||_|r6||_n|j|jƒ|_||_||_||_||_dS(Ns+You need to specify a non-empty branch URL.(	RR@Rutbranch_namet_find_default_branch_nametbranch_titletbranch_descriptiontauthor_emailtproduct_name(RRuRŠRŒRRŽR((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR$s				cC@s(|j|j|j|j|j|jfS(s Return xmlrpc request parameters(RuRŠRŒRRŽR(R((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR‚7scC@s|jdƒ}||dS(NRni(trfind(RRuti((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR‹Cs(R
RR}RƒRR‚R‹(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRˆs	tBranchBugLinkRequestcB@s&eZdZdZd„Zd„ZRS(s3Request to link a bzr branch in Launchpad to a bug.tlink_branch_to_bugcC@s||_||_dS(N(tbug_idRu(RRuR”((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRMs	cC@s|j|jdfS(s Return xmlrpc request parametersR>(RuR”(R((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR‚Qs(R
RR}RƒRR‚(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR’Hs	RocB@s,eZdZdZeZd„Zd„ZRS(s4Request to resolve the path component of an lp: URL.tresolve_lp_pathcC@s.|s!tjd|ddƒ‚n||_dS(NR?textrasYou must specify a project.(RR@R?(RR?((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR^scC@s
|jfS(s Return xmlrpc request parameters(R?(R((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyR‚ds(R
RR}RƒtFalseR„RR‚(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyRoXs
	(t
__future__RR8R^turlparseRRR0RtbzrlibRRRRR3tbzrlib.transport.httpRR
RRRRtobjectR(RR‡RˆR’Ro(((sL/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_registration.pyt<module>s "®
)

Copyright © 2017 || Recoded By Mr.Bumblebee