403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/landscape/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/lib/persist.pyc
ó
}9Rc@sddlZddlZddlZddlZdddddddd	gZeƒZdefd
„ƒYZd	efd„ƒYZ	defd„ƒYZ
defd
„ƒYZejdƒj
Zd„Zd„Zdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(iÿÿÿÿNtPersistt
PickleBackendtBPickleBackendtpath_string_to_tupletpath_tuple_to_stringt
RootedPersisttPersistErrortPersistReadOnlyErrorcBseZRS((t__name__t
__module__(((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR#scBseZRS((RR	(((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR'scBs"eZdZddd„Zd„Zd„Zd„ZeeeƒZ	eeƒZ
d„Zd„Zd„Z
dd„Zeed	„Zeeed
„Zeeeed„Zeeed„Zdeeed
„Zeed„Zeeed„Zeeed„Zeed„Zd„ZRS(sPersist a hierarchical database of key=>value pairs.

    There are three different kinds of option maps, regarding the
    persistence and priority that maps are queried.

      - hard - Options are persistent.
      - soft - Options are not persistent, and have a higher priority
           than persistent options.
      - weak - Options are not persistent, and have a lower priority
           than persistent options.

    @ivar filename: The name of the file where persist data is saved
        or None if no filename is available.

    cCs˜|dkrtƒ}n||_|jƒ|_i|_i|_t|_t|_	||_
||_|dk	r”tj
j|ƒr”|j|ƒndS(s…
        @param backend: The backend to use. If none is specified,
            L{BPickleBackend} will be used.
        @param filename: The default filename to save to and load from. If
            specified, and the file exists, it will be immediately
            loaded. Specifying this will also allow L{save} to be called
            without any arguments to save the persist.
        N(tNoneRt_backendtnewt_hardmapt_softmapt_weakmaptFalset	_readonlyt	_modifiedt_configtfilenametostpathtexiststload(tselftbackendR((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyt__init__=s								cCs|jS(N(R(R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyt
_get_readonlySscCst|ƒ|_dS(N(tboolR(Rtflag((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyt
_set_readonlyVscCs|jS(N(R(R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyt
_get_modifiedYscCs
t|_dS(s(Set the database status as non-modified.N(RR(R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pytreset_modified_scCs|jrtdƒ‚ndS(sRAssert if the object is writable

        @raise: L{PersistReadOnlyError}
        s"Configuration is in readonly mode.N(RR(R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pytassert_writablecs	cs½‡‡fd†}tjjˆƒ‰tjjˆƒsV|ƒrCdStdˆƒ‚ntjjˆƒdkry|ƒdSyˆjjˆƒˆ_Wn$|ƒr¥dStdˆƒ‚nXdS(sLoad a persisted database.csoˆd}tjj|ƒrktjj|ƒdkrkyˆjj|ƒˆ_Wntd|ƒ‚nXtSt	S(Ns.oldisBroken configuration file at %s(
RRtisfiletgetsizeRRR
RtTrueR(tfilepathold(tfilepathR(s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pytload_oldns
NsFile not found: %sisBroken configuration file at %s(	RRt
expanduserR#RR$RRR
(RR'R(((RR's9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRks		cCsÆ|dkr6|jdkr*tdƒ‚n|j}ntjj|ƒ}tjj|ƒrqtj||dƒntjj|ƒ}|r¬tjj	|ƒr¬tj
|ƒn|jj||j
ƒdS(s÷Save the persist to the given C{filepath}.

        If None is specified, then the filename passed during construction will
        be used.

        If the destination file already exists, it will be renamed
        to C{<filepath>.old}.
        sNeed a filename!s.oldN(R
RRRRR)R#trenametdirnametisdirtmakedirsRtsaveR
(RR'R+((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR.‹s	c
CsØ|tk	r!|jj|ƒ}nt|ƒ}t}|}x˜|rÓ|}|jdƒ}|jj||ƒ}|tkrÀ|r’|t|ƒ }ntdt	|ƒt
|ƒt|ƒfƒ‚n||kr<Pq<q<W||k	r
||k	rÔ|jj|||ƒ}qÔnÊ||kr|}nµx²t
rÓt|ƒdkrbt	|dƒtkrYg}	qhi}	n|}	|jj|||	ƒ}|tkr±tdt	|ƒt	|ƒfƒ‚n|s»Pn|}|jdƒ}q"W|S(NisCan't traverse %r (%r): %rsCan't traverse %r with %r(tNOTHINGRtcopytlisttpoptgettNotImplementedtlenRttypeRtstrtsetR%tint(
RtobjRtdefaulttsetvaluetqueuetmarkertnewobjtelemtnewvalue((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyt	_traverse sJ					cCsôt|ƒtkr!t|ƒ}nt}|rH|j|j||ƒ}n¨|ri|j|j||ƒ}n‡|rŠ|j|j||ƒ}nf|j|j||ƒ}||krð|j|j||ƒ}||krð|j|j||ƒ}qðn|S(N(R6R7RR/RBRR
R(RRtsoftthardtweakR>tvalue((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyt	_getvalueËsc	Cs||j||||ƒ}t}||kr.tS||kr>tS|jj||ƒ}|tkrxtdt|ƒƒ‚n|S(NsCan't check %r for containment(	RGR/RR%RthasR4RR6(	RRRFRCRDRER:R>tresult((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRHÝscCsc|j||||ƒ}|tkr(gS|jj|ƒ}|tkr_tdt|ƒƒ‚n|S(NsCan't return keys for %s(RGR/RtkeysR4RR6(RRRCRDRER:RI((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRJéscCs8|j||||ƒ}|tkr(|S|jj|ƒS(N(RGR/RR0(RRR;RCRDRERF((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR3òscCs‡|st‚t|ƒtkr-t|ƒ}n|r?|j}n.|rQ|j}n|jƒt|_|j	}|j
||d|ƒdS(NR<(tAssertionErrorR6R7RRRR"R%RR
RB(RRRFRCREtmap((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR8øs
		cCsÔ|st‚t|ƒtkr-t|ƒ}n|r?|j}n.|rQ|j}n|jƒt|_|j	}|rª|j
||ƒ}t|ƒtkrª||krªdSn|tj
f}|j
||d|ƒdS(NR<(RKR6R7RRRR"R%RR
RBR1tsystmaxint(RRRFtuniqueRCRERLtcurrent((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pytadds 
		cCsd|st‚t|ƒtkr-t|ƒ}n|r?|j}n.|rQ|j}n|jƒt|_|j	}t
}xê|r_||kr±|j||d ƒ}|d}t}	n|j||ƒ}|}t}	t}
||k	r'|j
j|||	ƒ}
|
tkr'td|t|ƒfƒ‚q'n|j
j|ƒr[||k	rN|}q\|d }qvPqvW|
S(NiÿÿÿÿsCan't remove %r from %r(RKR6R7RRRR"R%RR
R/RBRRtremoveR4Rtempty(RRRFRCRERLR>R:R@tisvalueRI((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRRs>
			
		
cCsÎ|p	|s|jƒnt|ƒtkr:t|ƒ}nt|ƒtkr[t|ƒ}nt}t}|j|||p|||ƒ}||k	rÊ|j|d|d|ƒ|j||||ƒt	}n|S(NRCRE(
R"R6R7RRR/RGRRR8R%(RtoldpathtnewpathRCRERIR>RF((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pytmove>s
	cCs
t||ƒS(sv
        Rebase the database hierarchy.

        @return: A L{RootedPersist} using this L{Persist} as parent.
        (R(RR((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pytroot_atNsN(RR	t__doc__R
RRRR tpropertytreadonlytmodifiedR!R"RR.R/RBRRGRHRJR3R8RQRRRWRX(((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR+s*						 +	%cBsÅeZdZd„Zed„ƒZed„ƒZd„Zee	e	e	d„Z
e	e	e	d„Zd
e	e	e	d„Z
e	e	d„Ze	e	e	d	„Zee	e	d
„Ze	e	d„Zd„ZRS(sxRoot a L{Persist}'s tree at a particular branch.

    This class shares the same interface of L{Persist} and provides a shortcut
    to access the nodes of a particular branch in a L{Persist}'s tree.

    The chosen branch will be viewed as the root of the tree of the
    L{RootedPersist} and all operations will be forwarded to the parent
    L{Persist} as appropriate.
    cCs:||_t|ƒtkr-t|ƒ|_n	||_dS(s¶
        @param parent: the parent L{Persist}.
        @param root: a branch of the parent L{Persist}'s tree, that
            will be used as root of this L{RootedPersist}.
        N(tparentR6R7Rtroot(RR]R^((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRbs	cCs
|jjS(N(R]R[(R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyt<lambda>nscCs
|jjS(N(R]R\(R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR_oscCs|jjƒdS(N(R]R"(R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR"qscCsDt|ƒtkr!t|ƒ}n|jj|j|||||ƒS(N(R6R7RR]RHR^(RRRFRCRDRE((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRHtscCsAt|ƒtkr!t|ƒ}n|jj|j||||ƒS(N(R6R7RR]RJR^(RRRCRDRE((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRJyscCsDt|ƒtkr!t|ƒ}n|jj|j|||||ƒS(N(R6R7RR]R3R^(RRR;RCRDRE((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR3~scCsAt|ƒtkr!t|ƒ}n|jj|j||||ƒS(N(R6R7RR]R8R^(RRRFRCRE((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR8ƒscCsDt|ƒtkr!t|ƒ}n|jj|j|||||ƒS(N(R6R7RR]RQR^(RRRFRORCRE((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRQˆscCsAt|ƒtkr!t|ƒ}n|jj|j||||ƒS(N(R6R7RR]RRR^(RRRFRCRE((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRRscCsit|ƒtkr!t|ƒ}nt|ƒtkrBt|ƒ}n|jj|j||j|||ƒS(N(R6R7RR]RWR^(RRURVRCRE((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRW’scCs8t|ƒtkr!t|ƒ}n|jj|j|ƒS(N(R6R7RR]RXR^(RR((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRXšsN(RR	RYRRZR[R\R"R/RRHRJR
R3R8RQRRRWRX(((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRWs			s(\[-?\d+\])|(?<!\\)\.cCsÓd|krd|kr|fSg}t|ƒ}x•|D]}|r8|ddkr©|ddkr©y|jt|dd!ƒƒWqÂtk
r¥td|ƒ‚qÂXqÅ|j|jddƒƒq8q8Wt|ƒS(	s‹Convert a L{Persist} path string to a path tuple.

    Examples:

        >>> path_string_to_tuple("ab")
        ("ab",)
        >>> path_string_to_tuple("ab.cd")
        ("ab", "cd"))
        >>> path_string_to_tuple("ab[0][1]")
        ("ab", 0, 1)
        >>> path_string_to_tuple("ab[0].cd[1]")
        ("ab", 0, "cd", 1)

    Raises L{PersistError} if the given path string is invalid.
    t.t[iiÿÿÿÿt]isInvalid path index: %rs\.(t
_splitpathtappendR9t
ValueErrorRtreplacettuple(RRIttokensttoken((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR£s
 
 cCslg}xV|D]N}t|ƒtkr<|dcd|7<q
|jt|ƒjddƒƒq
Wdj|ƒS(Niÿÿÿÿs[%d]R`s\.(R6R9RdR7Rftjoin(RRIR@((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRÃs
#tBackendcBskeZdZd„Zd„Zd„Zed„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
RS(s$
    Base class for L{Persist} backends implementing hierarchical storage
    functionality.

    Each node of the hierarchy is an object of type C{dict}, C{list}
    or C{tuple}. A node can have zero or more children, each child can be
    another node or a leaf value compatible with the backend's serialization
    mechanism.

    Each child element is associated with a unique key, that can be used to
    get, set or remove the child itself from its containing node. If the node
    object is of type C{dict}, then the child keys will be the keys of the
    dictionary, otherwise if the node object is of type C{list} or C{tuple}
    the child element keys are the indexes of the available items, or the value
    of items theselves.

    The root node object is always a C{dict}.

    For example:

        >>> root = backend.new()
        >>> backend.set(root, "foo", "bar")
        'bar'
        >>> egg = backend.set(root, "egg", [1, 2, 3])
        >>> backend.set(egg, 0, 10)
        10
        >>> root
        {'foo': 'bar', 'egg': [10, 2, 3]}
    cCs
t‚dS(N(tNotImplementedError(R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRìscCs
t‚dS(N(Rl(RR'((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRïscCs
t‚dS(N(Rl(RR'RL((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR.òscCs¤t|ƒtkr'|j||ƒ}nyt|ƒttfkršt|ƒtkr|y||}Wq—tk
rx|}q—Xq ||kr‘|}q |}nt}|S(s(Lookup a child in the given node object.(R6tdictR3RgR1R9t
IndexErrorR4(RR:R@t_markerR?((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR3õs

		cCsÇt|ƒtkr#|}||<n t|ƒtkr½t|ƒtkr½t|ƒ}||kru|jdƒ|}n7|dkr¬t|ƒ|kr¬|jddƒd}n|}||<nt	}|S(s:Set the value of the given child in the given node object.iN(
R6RmR1R9R5RdR
tabstinsertR4(RR:R@RFR?tlenobj((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR8s$
		cCsÒt}t|ƒtkr7||krÎ||=t}qÎn—t|ƒtkrÈ|rŠt|ƒtkrŠy||=t}WqÅtk
r†qÅXqÎ||krÎg|D]}||kr|^q|(t}qÎnt}|S(sîRemove a the given child in the given node object.

        @param isvalue: In case the node object is a C{list}, a boolean
            indicating if C{elem} is the index of the child or the value
            of the child itself.
        (RR6RmR%R1R9RnR4(RR:R@RTRItx((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRRs"

&cCs)t|ƒttfkr%tj|ƒS|S(sCopy a node or a value.(R6RmR1R0tdeepcopy(RRF((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR02s
cCs|S(s.Whether the given node object has no children.((RR:((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRS8scCs&t|ddƒ}|r"||ƒStS(s?Whether the given node object contains the given child element.t__contains__N(tgetattrR
R4(RR:R@tcontains((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRH<s
cCsEt|ddƒ}|r|ƒSt|ƒtkrAtt|ƒƒStS(s?Return the keys of the child elements of the given node object.RJN(RvR
R6R1trangeR5R4(RR:RJ((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRJCs(RR	RYRRR.R/R3R8RRR0RSRHRJ(((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRkÍs								cBs,eZd„Zd„Zd„Zd„ZRS(cCsddl}||_dS(Niÿÿÿÿ(tcPicklet_pickle(RRy((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyROscCsiS(N((R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRSscCs2t|ƒ}z|jj|ƒSWd|jƒXdS(N(topenRzRtclose(RR'tfile((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRVscCs;t|dƒ}z|jj||dƒWd|jƒXdS(Ntwi(R{RztdumpR|(RR'RLR}((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR.]s(RR	RRRR.(((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRMs			cBs,eZd„Zd„Zd„Zd„ZRS(cCsddlm}||_dS(Niÿÿÿÿ(tbpickle(t
landscape.libR€t_bpickle(RR€((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRgscCsiS(N((R((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRkscCs8t|ƒ}z|jj|jƒƒSWd|jƒXdS(N(R{R‚tloadstreadR|(RR'R}((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRnscCs>t|dƒ}z|j|jj|ƒƒWd|jƒXdS(NR~(R{twriteR‚tdumpsR|(RR'RLR}((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyR.us(RR	RRRR.(((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyRes			(RRMR0tret__all__tobjectR/t	ExceptionRRRRtcompiletsplitRcRRRkRR(((s9/usr/lib/python2.7/dist-packages/landscape/lib/persist.pyt<module>s$			ÿ-I	 	
€

Youez - 2016 - github.com/yon3zu
LinuXploit