-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
î:ïNc@@s¨dZddlmZddlZddlmZmZejdƒZdZ	de
fd„ƒYZd	efd
„ƒYZdefd„ƒYZ
dd
„Zd„ZdS(s«View management.

Views are contained within a working tree and normally constructed
when first accessed.  Clients should do, for example, ...

  tree.views.lookup_view()
i(tabsolute_importN(terrorstosutilssBazaar views format (\d+)sBazaar views format 1
t_ViewscB@seZdZd„ZRS(sBase class for View managers.cC@st|jƒ‚dS(N(tNotImplementedErrortsupports_views(tself((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyR*s(t__name__t
__module__t__doc__R(((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyR'stPathBasedViewscB@sweZdZd„Zd„Zd„Zd„Zdd„Ze	d„Z
d„Zd„Zd	„Z
d
„Zd„ZRS(
sÔView storage in an unversioned tree control file.

    Views are stored in terms of paths relative to the tree root.

    The top line of the control file is a format marker in the format:

      Bazaar views format X

    where X is an integer number. After this top line, version 1 format is
    stored as follows:

     * optional name-values pairs in the format 'name=value'

     * optional view definitions, one per line in the format

       views:
       name file1 file2 ...
       name file1 file2 ...

    where the fields are separated by a nul character (). The views file
    is encoded in utf-8. The only supported keyword in version 1 is
    'current' which stores the name of the current view, if any.
    cC@s(||_t|_d|_i|_dS(N(ttreetFalset_loadedtNonet_currentt_views(RR((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyt__init__Gs			cC@stS(N(tTrue(R((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyRMscC@s|jƒ|j|jfS(sðGet the current view and dictionary of views.

        :return: current, views where
          current = the name of the current view or None if no view is enabled
          views = a map from view name to list of files/directories
        (t_load_view_infoRR(R((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyt
get_view_infoPs
cC@sl|dk	r*||kr*tj|ƒ‚n|jjƒz ||_||_|jƒWd|jjƒXdS(sÜSet the current view and dictionary of views.

        :param current: the name of the current view or None if no view is
          enabled
        :param views: a map from view name to list of files/directories
        N(	RRt
NoSuchViewRt
lock_writeRRt_save_view_infotunlock(Rtcurrenttviews((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyt
set_view_infoZs
		cC@sh|jƒy7|dkr5|jr.|j}q5gSn|j|SWn tk
rctj|ƒ‚nXdS(s»Return the contents of a view.

        :param view_Name: name of the view or None to lookup the current view
        :return: the list of files/directories in the requested view
        N(RRRRtKeyErrorRR(Rt	view_name((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pytlookup_viewks
	
cC@sY|jjƒz7|jƒ||j|<|r9||_n|jƒWd|jjƒXdS(sáAdd or update a view definition.

        :param view_name: the name of the view
        :param view_files: the list of files/directories in the view
        :param make_current: make this view the current one or not
        N(RRRRRRR(RRt
view_filestmake_current((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pytset_view|s


cC@s†|jjƒzd|jƒy|j|=Wn tk
rJtj|ƒ‚nX||jkrfd|_n|j	ƒWd|jj
ƒXdS(snDelete a view definition.

        If the view deleted is the current one, the current view is reset.
        N(RRRRRRRRRRR(RR((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pytdelete_views


cC@ss|jjƒzQ|jdkr(i}ni|jd6}|jjjd|j||jƒƒWd|jjƒXdS(sŸSave the current view and all view definitions.

        Be sure to have initialised self._current and self._views before
        calling this method.
        RRN(	RRRRt
_transportt	put_bytest_serialize_view_contentRR(Rtkeywords((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyRŸs
	cC@sª|js¦|jjƒzsy|jjjdƒ}Wn)tjk
r]}di|_|_	n+X|j
|ƒ\}|_	|jdƒ|_Wd|jjƒXt
|_ndS(s9Load the current view and dictionary of view definitions.RRN(R
Rt	lock_readR#t	get_bytesRt
NoSuchFileRRRt_deserialize_view_contenttgetRR(Rtview_contentteR&((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyR°s	
cC@sºtg}x8|D]0}d|||f}|j|jdƒƒqW|r­|jdjdƒƒxJt|ƒD]9}d|dj||ƒf}|j|jdƒƒqmWndj|ƒS(s:Convert view keywords and a view dictionary into a stream.s%s=%s
sutf-8sviews:
s%s%s
tt(t_VIEWS_FORMAT1_MARKERtappendtencodetsortedtjoin(RR&t	view_dicttlinestkeytlinetviewt	view_data((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyR%Ás	
cC@s|dkriifS|jƒ}tj|dƒ}|sJtdƒ‚n1|jdƒdkr{td|jdƒƒ‚nyÖi}i}t}x³|dD]§}|jdƒ}|rá|jdƒ}	|	jdƒ}
|	||
<q›|d	krùt	}q›q›|j
d
ƒdkr3|jd
dƒ\}}|||<q›td|ƒ‚q›W||fSWn)tk
r|}
td||
fƒ‚nXd
S(s>Convert a stream into view keywords and a dictionary of views.R/is,format marker missing from top of views fileit1scannot decode views format %ssutf-8R.sviews:t=s#failed to deserialize views line %ss*failed to deserialize views content %r: %sN(t
splitlinest_VIEWS_FORMAT_MARKER_REtmatcht
ValueErrortgroupRtdecodetsplittpopRtfind(RR,R6R?R&Rtin_viewsR8ttexttpartsR9tkeywordtvalueR-((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyR*Îs@



N(RRR	RRRRRRRR!R"RRR%R*(((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyR
.s			
					
t
DisabledViewscB@sGeZdZd„Zd„Zd„ZeZeZeZeZ	eZ
RS(slView storage that refuses to store anything.

    This is used by older formats that can't store views.
    cC@s
||_dS(N(R(RR((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyRüscC@stS(N(R(R((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyRÿscO@stj|jƒ‚dS(N(RtViewsNotSupportedR(Rtatk((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyt_not_supporteds(RRR	RRRORRRR!R"(((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyRKös			cC@sI|dkrdj|ƒSdjg|D]}|j|dƒ^q&ƒSdS(sžGet the display string for a list of view files.

    :param view_files: the list of file names
    :param encoding: the encoding to display the files in
    s, treplaceN(RR4R2(Rtencodingtv((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pytview_display_strs
cC@sP|jƒrL|jjƒ}|rLtj||ƒrLtj||ƒ‚qLndS(sBIf a working tree has a view enabled, check the path is within it.N(RRRRt
is_inside_anyRtFileOutsideView(RtrelpathR((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pytcheck_path_in_views(R	t
__future__RtretbzrlibRRtcompileR>R0tobjectRR
RKRRSRW(((s0/usr/lib/python2.7/dist-packages/bzrlib/views.pyt<module>sÈ

Copyright © 2017 || Recoded By Mr.Bumblebee