-=[ 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_api.pyc

σ
™t	Pc@@sjdZddlmZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZddl
mZddlmZyddlZWn%ek
rΏZe	jdeƒ‚nXddlmZmZdd	lmZdZd„Zd
„Zd„Zd„Zd„Zde	jfd„ƒYZ ddej"d„Z#de$fd„ƒYZ%d„Z&dS(s)Tools for dealing with the Launchpad API.i(tabsolute_importN(tbranchtconfigterrorstosutilsttracet	transport(tgettext(tInvalidLaunchpadInstancetlaunchpadlib(tSTAGING_SERVICE_ROOTt	Launchpad(turisiicC@stjtjƒdƒS(s6Return the directory to cache launchpadlib objects in.t	launchpad(RtpathjoinRt
config_dir(((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pytget_cache_directory<scC@sttt|jdƒƒƒS(s9Parse a version number of the style used by launchpadlib.t.(ttupletmaptinttsplit(tversion_number((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pytparse_launchpadlib_versionAscC@s:ttjƒ}|tkr6tjdt||ƒ‚ndS(s<Raise an error if launchpadlib has the wrong version number.R	N(RR	t__version__tMINIMUM_LAUNCHPADLIB_VERSIONRtIncompatibleAPI(tinstalled_version((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyt check_launchpadlib_compatibilityFs
cC@sWytj|ƒSWn?tk
rR|dkr3‚ntjdƒ}|jddƒSXdS(Nt	qastagingtstaging(Rtlookup_service_roott
ValueErrortreplace(tservice_roottstaging_root((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyROs
cC@sV|jdkr|j}n	|j}yt|ƒSWntk
rQt|ƒ‚nXdS(sφReturn the root URL of the Launchpad API.

    e.g. For the 'staging' Launchpad service, this function returns
    launchpadlib.launchpad.STAGING_SERVICE_ROOT.

    :param service: A `LaunchpadService` object.
    :return: A URL as a string.
    N(t_lp_instancetNonetDEFAULT_INSTANCERR R(tservicetlp_instance((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyt_get_api_urlYs		
tNoLaunchpadBranchcB@seZdZd„ZRS(s8No launchpad branch could be found for branch "%(url)s".cC@s#tjj|d|d|jƒdS(NRturl(RtBzrErrort__init__tbase(tselfR((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyR-os(t__name__t
__module__t_fmtR-(((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyR*lsc
C@sJtƒ}tjdt|ƒ|d|d|d|ƒ}tj|dƒ|S(s^Log in to the Launchpad API.

    :return: The root `Launchpad` object from launchpadlib.
    tbzrttimeoutt
proxy_infotversioniΐ(RRt
login_withR)Rtchmod_if_possible(R'R4R5R6tcache_directoryR
((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pytloginss	tLaunchpadBranchcB@s€eZdZded„Zed„ƒZed„ƒZe	d„ƒZ
e	d„ƒZe	d„ƒZe
ed„ƒZe
d„ƒZd	„Zd
„Zd„ZRS(
s4Provide bzr and lp API access to a Launchpad branch.cC@s1||_||_d|_||_||_dS(sΉConstructor.

        :param lp_branch: The Launchpad branch.
        :param bzr_url: The URL of the Bazaar branch.
        :param bzr_branch: An instance of the Bazaar branch.
        N(tbzr_urlt_bzrR%t	_push_bzrt
_check_updatetlp(R/t	lp_branchR<t
bzr_branchtcheck_update((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyR-†s
				cC@s1|jdkr*tjj|jƒ|_n|jS(s&Return the bzr branch for this branch.N(R=R%RtBranchtopenR<(R/((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyR3“scC@s4|jdkr-tjj|jjƒ|_n|jS(s'Return the push branch for this branch.N(R>R%RRDRER@tbzr_identity(R/((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pytpush_bzršscC@sE|dkrtS|jdƒr#tStjdƒ}t|j|ƒƒS(s Is 'url' something that could conceivably be pushed to LP?

        :param url: A URL that may refer to a Launchpad branch.
        :return: A boolean.
        slp:s3([a-z]*\+)*(bzr\+ssh|http)://bazaar.*.launchpad.netN(R%tFalset
startswithtTruetretcompiletbooltmatch(R+tregex((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pytplausible_launchpad_url‘scc@sl|jƒ}|dk	r |Vn|jƒ}|dk	r@|Vn|jƒ}|dk	r`|Vn|jVdS(s―Iterate through related URLs that might be Launchpad URLs.

        :param bzr_branch: A Bazaar branch to find URLs from.
        :return: a generator of URL strings.
        N(tget_public_branchR%tget_push_locationt
get_parentR.(RBR+((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pytcandidate_urls°scC@sTt|jƒtkr%|jddƒSt|jƒtdƒkrP|jddƒS|S(s-Adjust a URL to work with staging, if needed.sbazaar.launchpad.netsbazaar.staging.launchpad.netRsbazaar.qastaging.launchpad.net(tstrt	_root_uriR
R!R(R+R
((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyt	tweak_urlΒs		cC@s―t}x|j|ƒD]R}|j||ƒ}|j|ƒsCqn|jjd|ƒ}|dk	rPqqW|st|ƒ‚n|j||ƒ}t	}|||j
||ƒS(s*Find a Launchpad branch from a bzr branch.R+N(RJRTRWRPtbranchestgetByUrlR%R*t
create_nowRHR.(tclsR
RBtcreate_missingRCR+RA((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pytfrom_bzrΝscC@s|j|jƒ|ƒ}|j|ƒsFtjtdƒ|jƒ‚n|jtj	|ƒƒ|j
jd|ƒ}|dkr™tjtdƒ|ƒ‚n|S(s<Create a Bazaar branch on Launchpad for the supplied branch.s!%s is not registered on LaunchpadR+N(
RWRRRPRR,RR.tcreate_clone_on_transportRt
get_transportRXRYR%(R[R
RBR+RA((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyRZίs
cC@s|j}|jdk	rƒ|jj}|dkrOtjtdƒ|jƒ‚n|j}|dkrρtjtdƒ|ƒ‚qρnn|j	dk	rΥ|j	j
ddƒ}|dkrρtjtdƒ|j	ƒ‚qρntjtdƒ|jƒ‚t||jƒS(s8Return the 'LaunchpadBranch' for the target of this one.s%s has no development focus.s#development focus %s has no branch.tpockettReleases source package %s has no branch.s/%s has no associated product or source package.N(R@tprojectR%tdevelopment_focusRR,RRFRt
sourcepackaget	getBranchR;(R/RAt	dev_focusttarget((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyt
get_targetνs(					
cC@s|js
dS|jjƒzΣ|jjdk	rΩ|jjƒ|jjkrktjt	dƒ|jj
ƒdS|jjjƒ}|j
|jj|jjƒƒsΉtj|j|jƒ‚ntjt	dƒ|jj
ƒn|jj|jƒWd|jjƒXdS(s)Update the Launchpad copy of this branch.Ns%s is already up-to-date.s
Pushing to %s(R?R3t	lock_readR@tlast_scanned_idR%t
last_revisionRtnoteRRFt
repositoryt	get_graphtis_ancestorRtDivergedBranchesRGtpushtunlock(R/tgraph((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyt	update_lps 	
 cC@sR|jjj|jjƒ}|j|jjƒ|jjƒƒ}|jjj|ƒS(s»Find the revision tree for the LCA of this branch and other.

        :param other: Another LaunchpadBranch
        :return: The RevisionTree of the LCA of this branch and other.
        (R3RmRntfind_unique_lcaRkt
revision_tree(R/totherRstlca((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyt
find_lca_treesN(R0R1t__doc__R%RJR-tpropertyR3RGtstaticmethodRPRTRWtclassmethodR]RZRhRtRy(((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyR;ƒs
		cC@swtjt|jƒƒ\}}}}}}dj|jdƒdƒ}|jddƒ}tj||||||fƒS(s&Return the canonical URL for a branch.t/isapi.scode.(turlparseRUt	self_linktjoinRR!t
urlunparse(tobjecttschemetnetloctpathtparamstquerytfragment((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyt
canonical_url%s$(iii('Rzt
__future__RtosRKRtbzrlibRRRRRRtbzrlib.i18nRt(bzrlib.plugins.launchpad.lp_registrationRR	tImportErrortetDependencyNotPresenttlaunchpadlib.launchpadR
RRRRRRRR)R,R*R%tDEFAULT_VERSIONR:RƒR;RŠ(((sC/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_api.pyt<module>s0.					
	’

Copyright © 2017 || Recoded By Mr.Bumblebee