-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
î:ïNc@@s¤dZddlmZddlZddlmZmZddlmZm	Z	ddl
mZdefd„ƒYZ
d	efd
„ƒYZdefd„ƒYZdS(
s†
Stores are the main data-storage mechanism for Bazaar.

A store is a simple write-once container indexed by a universally
unique ID.
i(tabsolute_importN(terrorst
versionedfile(tBzrErrortUnlistableStore(tmuttert
StoreErrorcB@seZRS((t__name__t
__module__(((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR)stStorecB@sweZdZd„Zdd„Zd„Zd„Zd„Zdd„Z	d„Z
dd„Zded	„Z
d
„ZRS(sñThis class represents the abstract storage layout for saving information.

    Files can be added, but not modified once they are in.  Typically
    the hash is used as the name, or something else known to be unique,
    such as a UUID.
    cC@stdƒ‚dS(Ns#Children should define their length(tNotImplementedError(tself((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt__len__5scC@s
t‚dS(s}Returns a file reading from a particular entry.

        If suffix is present, retrieve the named suffix for fileid.
        N(R
(Rtfileidtsuffix((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pytget8scC@s
t‚dS(s,DEPRECATED. Please use .get(fileid) instead.N(R
(RR
((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt__getitem__?scC@s
t‚dS(N(R
(R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt__iter__CscC@stdƒ‚dS(sAAdd a file object f to the store accessible from the given fileids=Children of Store must define their method of adding entries.N(R
(RtfR
((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pytaddFscC@s
t‚dS(s™Return True or false for the presence of fileid in the store.

        suffix, if present, is a per file suffix, i.e. for digital signature
        data.N(R
(RR
R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pythas_idJscC@st|ddƒdk	S(s/Return True if this store is able to be listed.RN(tgetattrtNone(R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pytlistableQscC@s¡|jƒst|ƒ‚ng}xCt|ƒD]5\}}|rV|jd||ƒn|j|ƒq.W|rz|jƒntd|ƒ|j||d|ƒdS(s0Copy all the file ids from store_from into self.s
listing filesscopy_all ids: %rtpbN(RRt	enumeratetupdatetappendtclearRt
copy_multi(Rt
store_fromRtidstcounttfile_id((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pytcopy_all_idsUs

c	C@s|r|jdƒntƒ}d}xØ|D]Ð}|d7}|j|ƒrQq,ny~|j|d||ƒx?|jD]4}y|j||||ƒWqttk
r§qtXqtW|rÎ|jd|t|ƒƒnWq,tk
rû|rõ|j|ƒqü‚q,Xq,W|r|j	ƒn||fS(smCopy texts for ids from other into self.

        If an id is present in self, it is skipped.  A count of copied
        ids is returned, which may be less than len(ids).

        :param other: Another Store object
        :param ids: A list of entry ids to be copied
        :param pb: A ProgressTask object, if none is given, the default will be created.
        :param permit_failure: Allow missing entries to be ignored
        :return: (n_copied, [failed]) The number of entries copied successfully,
            followed by a list of entries which could not be copied (because they
            were missing)
        spreparing to copyiitcopyN(
RtsetRt	_copy_oneRt	_suffixestKeyErrortlenRR(	RtotherRRtpermit_failuretfailedR R
R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyRcs0	


 

cC@s6td|ƒ|j||ƒ}|j|||ƒdS(s
Most generic copy-one object routine.

        Subclasses can override this to provide an optimised
        copy between their own instances. Such overriden routines
        should call this if they have no optimised facility for a
        specific 'other'.
        sStore._copy_one: %rN(RRR(RR
RR)RR((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR%‹s
N(RRt__doc__RRRRRRRRR"tFalseRR%(((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR	-s					(tTransportStorecB@sËeZdZdd„Zd„Zd„Zd„Zdd„Zdd„Z	d„Z
dd„Zeedded	„Z
d
„Zd„Zd„Zdd
„Zd„ZeZd„Zd„Zd„ZRS(sFA TransportStore is a Store superclass for Stores that use Transports.cC@shtd|ƒ|j||ƒ}|jj|ƒrPtd|jj|fƒ‚n|j|d|ƒdS(sPAdd contents of a file into the store.

        f -- A file-like object
        sadd store entry %rsstore %r already contains id %riN(Rt_id_to_namest
_transportthas_anyRtbaset_add(RRR
Rtnames((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR›s
cC@stdƒ‚dS(sdActually add the file to the given location.
        This should be overridden by children.
        s)children need to implement this function.N(R
(RtrelpathR((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR3«scC@s`t|ƒtkr1tdt|ƒ|fƒ‚nd|ksId|kr\td|ƒ‚ndS(Ns$Fileids should be bytestrings: %s %rs\t/sinvalid store id %r(ttypetstrt	TypeErrort
ValueError(RR
((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt
_check_fileid±s
cC@s^|dk	r$|j||gƒ}n|j|ƒ}|d}|jrP||fS||fSdS(s&Return the names in the expected orders.gzN(Rt_relpatht_compressed(RR
Rtfntfn_gz((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR/¸s
	
cC@s|jj|j||ƒƒS(sSee Store.has_id.(R0R1R/(RR
R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyRÆscC@s:x3|j|d|ƒD]}|jj|ƒr|SqWdS(sÆA special check, which returns the name of an existing file.

        This is similar in spirit to 'has_id', but it is designed
        to return information about which file the store has.
        RN(R/R0thasR(RR
Rtname((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt	_get_nameÊscC@s
t‚dS(sªReturn an vanilla file stream for clients to read from.

        This is the body of a template method on 'get', and should be
        implemented by subclasses.
        N(R
(Rtfilename((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt_getÕscC@s[|j||ƒ}x6|D].}y|j|ƒSWqtjk
rFqXqWt|ƒ‚dS(sSee Store.get().N(R/RDRt
NoSuchFileR'(RR
RR4RA((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyRÝs
cC@sÄtt|ƒjƒ||_||_||_tƒ|_||_||_	||_
|rs|rstjƒ|_
nM|r’|r’tjƒ|_
n.|jr±td|fƒ‚ntjƒ|_
dS(Ns0%r: escaped unprefixed stores are not permitted.(tsuperR.t__init__R0t	_prefixedR=R$R&t_escapedt	_dir_modet
_file_modeRtHashEscapedPrefixMappert_mappertHashPrefixMapperR:tPrefixMapper(Rta_transporttprefixedt
compressedtdir_modet	file_modetescaped((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyRGçs"						
	cc@s#x|jjƒD]}|VqWdS(s+Iterate through the files in the transport.N(R0titer_files_recursive(Rtquoted_relpath((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt_iter_files_recursivescc@s½x¶|jƒD]¨}tjj|ƒ}|jdƒrA|d }nt}xMtt|jƒƒD]6}x-|jD]"}|jd|ƒrmt	}qmqmWq]W|s
|j
j|ƒdVq
q
WdS(Ns.gziýÿÿÿt.i(RXtostpathtbasenametendswithR-trangeR(R&tTrueRMtunmap(RR5RAtskipR R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyRs
cC@stt|jƒƒƒS(N(R(tlistR(R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyRscC@s‹|j|ƒ|rVxF|D]5}||jkrBtd|ƒ‚n|j|ƒqWng}|jj|fƒ}dj|g|ƒ}|S(NsUnregistered suffix %rRY(R;R&R:RMtmaptjoin(RR
tsuffixesRR[t	full_path((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR<s

cC@s;|jdkrd|jjSd|jj|jjfSdS(Ns%s(None)s%s(%r)(R0Rt	__class__RR2(R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt__repr__%scC@s
|jjƒS(s/Return True if this store is able to be listed.(R0R(R((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR-scC@s<|j|ƒ|dkr(tdƒ‚n|jj|ƒdS(s2Register a suffix as being expected in this store.tgzs$You cannot register the "gz" suffix.N(R;R:R&R(RR((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pytregister_suffix1s
cC@sSd}d}x:|jjƒD])}|d7}||jj|ƒj7}qW||fS(sqReturn (count, bytes)

        This is the (compressed) size stored on disk, not the size of
        the content.ii(R0RVtstattst_size(RttotalR R5((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt
total_size8s
N(RRR,RRR3R;R/RRBRDRR-RGRXRRR<Rht__str__RRjRn(((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyR.˜s*				
			
			(R,t
__future__RRZtbzrlibRRt
bzrlib.errorsRRtbzrlib.traceRt	ExceptionRtobjectR	R.(((s9/usr/lib/python2.7/dist-packages/bzrlib/store/__init__.pyt<module>sk

Copyright © 2017 || Recoded By Mr.Bumblebee