-=[ Mr. Bumblebee ]=-
_Indonesia_

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

σ
ΦiOc@@sΔdZddlmZddlmZmZddlmZeeƒdƒdej	fd„ƒYZ
e
ƒZdefd	„ƒYZ
ejd
e
dƒdefd
„ƒYZejdedƒdS(sΐDirectory service registration and usage.

Directory services are utilities that provide a mapping from URL-like strings
to true URLs.  Examples include lp:urls and per-user location aliases.
i(tabsolute_import(terrorstregistry(tlazy_importsh
from bzrlib import (
    branch as _mod_branch,
    controldir as _mod_controldir,
    urlutils,
    )
tDirectoryServiceRegistrycB@seZdZd„ZRS(s—This object maintains and uses a list of directory services.

    Directory services may be registered via the standard Registry methods.
    They will be invoked if their key is a prefix of the supplied URL.

    Each item registered should be a factory of objects that provide a look_up
    method, as invoked by dereference.  Specifically, look_up should accept a
    name and URL, and return a URL.
    cC@s>|j|ƒ}|dkr|S|\}}|ƒj||ƒS(s£Dereference a supplied URL if possible.

        URLs that match a registered directory service prefix are looked up in
        it.  Non-matching urls are returned verbatim.

        This is applied only once; the resulting URL must not be one that
        requires further dereferencing.

        :param url: The URL to dereference
        :return: The dereferenced URL if applicable, the input URL otherwise.
        N(t
get_prefixtNonetlook_up(tselfturltmatchtservicetname((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pytdereference2s
(t__name__t
__module__t__doc__R
(((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyR's	tAliasDirectorycB@sΘeZdZejƒZejdd„ddƒejdd„ddƒejdd	„dd
ƒejdd„dd
ƒejdd„ddƒejdd„ddƒd„Zed„ƒZ	RS(sΣDirectory lookup for locations associated with a branch.

    :parent, :submit, :public, :push, :this, and :bound are currently
    supported.  On error, a subclass of DirectoryLookupFailure will be raised.
    tparentcC@s
|jƒS(N(t
get_parent(tb((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyt<lambda>NsthelpsThe parent of this branch.tsubmitcC@s
|jƒS(N(tget_submit_branch(R((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyRPss"The submit branch for this branch.tpubliccC@s
|jƒS(N(tget_public_branch(R((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyRRss#The public location of this branch.tboundcC@s
|jƒS(N(tget_bound_location(R((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyRTss7The branch this branch is bound to, for bound branches.tpushcC@s
|jƒS(N(tget_push_location(R((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyRVss9The saved location used for `bzr push` with no arguments.tthiscC@s|jS(N(tbase(R((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyRXssThis branch.cC@sδtjjdƒd}|jddƒ}t|ƒdkrI|\}}n|\}d}y|jj|dƒ}Wn tk
r”t	j
|ƒ‚n
X||ƒ}|dkrΏt	j|ƒ‚n|dk	rΰtj
||ƒ}n|S(Nt.it/ii(t_mod_branchtBranchtopen_containingtsplittlenRtbranch_aliasestgettKeyErrorRtInvalidLocationAliastUnsetLocationAliasturlutilstjoin(RRR	tbranchtpartstextratmethodtresult((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyR[s 	
cC@sZg}x@|jjƒD]/}|jj|ƒ}|jd||fƒqWddj|ƒS(Ns  :%-10s%s
sLocation aliases
================

Bazaar defines several aliases for locations associated with a branch.  These
can be used with most commands that expect a location, such as `bzr push`.

The aliases are::

%s
For example, to push to the parent location::

    bzr push :parent
t(R(tkeystget_helptappendR.(tclsttopictalias_linestkeyR((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyt	help_textos
(
RRRRtRegistryR(tregisterRtclassmethodR<(((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyRFs 	t:s*Easy access to remembered branch locationstColocatedDirectorycB@seZdZd„ZRS(s‘Directory lookup for colocated branches.

    co:somename will resolve to the colocated branch with "somename" in
    the current directory.
    cC@s9tjjdƒd}tj|jitj|ƒd6ƒS(NR!iR/(t_mod_controldirt
ControlDirR%R-tjoin_segment_parameterstuser_urltescape(RRR	tdir((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyRs(RRRR(((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyRA‰ssco:s!Easy access to colocated branchesN(Rt
__future__RtbzrlibRRtbzrlib.lazy_importRtglobalsR=RtdirectoriestobjectRR>RA(((s</usr/lib/python2.7/dist-packages/bzrlib/directory_service.pyt<module>s		?


Copyright © 2017 || Recoded By Mr.Bumblebee