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/twisted/persisted/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyc
ó
[³XMc@sÓdZddlZddlZddlZddlZyddlZWnek
reddlZnXyeWne	k
r‡e
ZnXdfd„ƒYZdefd„ƒYZe
e
d„Z
dddgZdS(	s„
DBM-style interface to a directory.

Each key is stored as a single file.  This is not expected to be very fast or
efficient, but it's good for easy debugging.

DirDBMs are *not* thread-safe, they should only be accessed by one thread at
a time.

No files should be placed in the working directory of a DirDBM save those
created by the DirDBM itself!

Maintainer: Itamar Shtull-Trauring
iÿÿÿÿNtDirDBMcBsÎeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zdd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s­A directory with a DBM interface.
    
    This class presents a hash-like interface to a directory of small,
    flat files. It can only use strings as keys or values.
    cCsètjj|ƒ|_tjj|jƒs=tj|jƒn§x6tjtjj|jdƒƒD]}tj|ƒq_Wtjtjj|jdƒƒ}xJ|D]B}|d }tjj	|ƒrÐtj|ƒqžtj
||ƒqžWdS(sb
        @type name: str
        @param name: Base path to use for the directory storage.
        s*.news*.rpliüÿÿÿN(tostpathtabspathtdnametisdirtmkdirtglobtjointremovetexiststrename(tselftnametftreplacementstold((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt__init__/s
(!

cCs%tj|ƒjddƒjddƒS(s6Encode a key so it can be used as a filename.
        s
t_t/t-(tbase64tencodestringtreplace(Rtk((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt_encodeJscCs%tj|jddƒjddƒƒS(s*Decode a filename to get the key.
        Rs
RR(RtdecodestringR(RR((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt_decodePscCs)t|dƒ}|jƒ}|jƒ|S(s€Read in the contents of a file.
        
        Override in subclasses to e.g. provide transparently encrypted dirdbm.
        trb(t_opentreadtclose(RRRts((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt	_readFileUs
cCs4t|dƒ}|j|ƒ|jƒ|jƒdS(svWrite data to a file.
        
        Override in subclasses to e.g. provide transparently encrypted dirdbm.
        twbN(RtwritetflushR(RRtdataR((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt
_writeFile_s

cCsttj|jƒƒS(sF
        @return: The number of key/value pairs in this Shelf
        (tlenRtlistdirR(R((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt__len__iscCsöt|ƒtjks!tdƒ‚t|ƒtjksBtdƒ‚|j|ƒ}tjj|j|ƒ}tjj	|ƒrˆ|d}n
|d}y|j
||ƒWntj|ƒ‚n3Xtjj	|ƒrâtj|ƒntj||ƒdS(sØ
        C{dirdbm[k] = v}
        Create or modify a textfile in this directory

        @type k: str
        @param k: key to set
        
        @type v: str
        @param v: value to associate with C{k}
        sDirDBM key must be a stringsDirDBM value must be a strings.rpls.newN(
ttypettypest
StringTypetAssertionErrorRRRRRR
R&R	R(RRtvRtnew((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt__setitem__os!!


cCsjt|ƒtjks!tdƒ‚tjj|j|j|ƒƒ}y|j	|ƒSWnt
|‚nXdS(s
        C{dirdbm[k]}
        Get the contents of a file in this directory as a string.
        
        @type k: str
        @param k: key to lookup
        
        @return: The value associated with C{k}
        @raise KeyError: Raised when there is no such key
        sDirDBM key must be a stringN(R*R+R,R-RRRRRR!tKeyError(RRR((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt__getitem__Žs!!cCs†t|ƒtjks!tdƒ‚|j|ƒ}y#tjtjj|j	|ƒƒWn,t
tfk
rt|j
|ƒƒ‚nXdS(sÎ
        C{del dirdbm[foo]}
        Delete a file in this directory.
        
        @type k: str
        @param k: key to delete
        
        @raise KeyError: Raised when there is no such key
        sDirDBM key must be a stringN(R*R+R,R-RRR	RRRtOSErrortIOErrorR1R(RR((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt__delitem__ s
!#cCst|jtj|jƒƒS(s9
        @return: a C{list} of filenames (keys).
        (tmapRRR(R(R((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pytkeys¯scCs8g}|jƒ}x|D]}|j||ƒqW|S(s?
        @return: a C{list} of file-contents (values).
        (R7tappend(RtvalsR7tkey((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pytvaluesµs

cCs>g}|jƒ}x%|D]}|j|||fƒqW|S(sL
        @return: a C{list} of 2-tuples containing key/value pairs.
        (R7R8(RtitemsR7R:((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyR<¿s

cCsRt|ƒtjks!tdƒ‚|j|ƒ}tjjtjj|j	|ƒƒS(s³
        @type key: str
        @param key: The key to test
        
        @return: A true value if this dirdbm has the specified key, a faluse
        value otherwise.
        sDirDBM key must be a string(
R*R+R,R-RRRtisfileRR(RR:((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pythas_keyÉs!cCs%|j|ƒs|||<|S||S(s¼
        @type key: str
        @param key: The key to lookup
        
        @param value: The value to associate with key if key is not already
        associated with a value.
        (R>(RR:tvalue((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt
setdefaultÕs
cCs|j|ƒr||S|SdS(s
        @type key: str
        @param key: The key to lookup
        
        @param default: The value to return if the given key does not exist
        
        @return: The value associated with C{key} or C{default} if not
        C{self.has_key(key)}
        N(R>(RR:tdefault((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pytgetâs
cCsRt|ƒtjks!tdƒ‚|j|ƒ}tjjtjj|j	|ƒƒS(s¿
        C{key in dirdbm}

        @type key: str
        @param key: The key to test
                
        @return: A true value if C{self.has_key(key)}, a false value otherwise.
        sDirDBM key must be a string(
R*R+R,R-RRRR=RR(RR:((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt__contains__ñs	!cCs+x$|jƒD]\}}|||<q
WdS(sþ
        Add all the key/value pairs in C{dict} to this dirdbm.  Any conflicting
        keys will be overwritten with the values from C{dict}.

        @type dict: mapping
        @param dict: A mapping of key/value pairs to add to this dirdbm.
        N(R<(RtdictR:tval((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pytupdateþscCsitjj|ƒ}||jks't‚|j|ƒ}|jƒx"|jƒD]}||||<qMW|S(sL
        Copy the contents of this dirdbm to the dirdbm at C{path}.
        
        @type path: C{str}
        @param path: The path of the dirdbm to copy to.  If a dirdbm
        exists at the destination path, it is cleared first.
        
        @rtype: C{DirDBM}
        @return: The dirdbm this dirdbm was copied to.
        (RRRRR-t	__class__tclearR7(RRtdR((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pytcopyTo	s
cCs"x|jƒD]
}||=q
WdS(s<
        Delete all key/value pairs in this dirdbm.
        N(R7(RR((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyRHscCsdS(sL
        Close this dbm: no-op, for dbm-style interface compliance.
        N((R((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyR$scCsqt|ƒtjks!tdƒ‚tjj|j|j|ƒƒ}tjj	|ƒrdtjj
|ƒSt|‚dS(sÉ
        Returns modification time of an entry.
        
        @return: Last modification date (seconds since epoch) of entry C{key}
        @raise KeyError: Raised when there is no such key
        sDirDBM key must be a stringN(R*R+R,R-RRRRRR=tgetmtimeR1(RR:R((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pytgetModificationTime)s
!!N(t__name__t
__module__t__doc__RRRR!R&R)R0R2R5R7R;R<R>R@tNoneRBRCRFRJRHRRL(((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyR(s,				
	
						
	
		
	
				tShelfcBs eZdZd„Zd„ZRS(sÂA directory with a DBM shelf interface.
    
    This class presents a hash-like interface to a directory of small,
    flat files. Keys must be strings, but values can be any given object.
    cCs&tj|ƒ}tj|||ƒdS(sÉ
        C{shelf[foo] = bar}
        Create or modify a textfile in this directory.

        @type k: str
        @param k: The key to set

        @param v: The value to associate with C{key}
        N(tpickletdumpsRR0(RRR.((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyR0?s
cCstjtj||ƒƒS(s'
        C{dirdbm[foo]}
        Get and unpickle the contents of a file in this directory.
        
        @type k: str
        @param k: The key to lookup
        
        @return: The value associated with the given key
        @raise KeyError: Raised if the given key does not exist
        (RRtloadsRR2(RR((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyR2Ls(RMRNROR0R2(((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyRQ8s	
cCs
t|ƒS(s§
    This is for 'anydbm' compatibility.
    
    @param file: The parameter to pass to the DirDBM constructor.

    @param flag: ignored
    @param mode: ignored
    (R(tfiletflagtmode((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pytopenZs	RX(RORR+RRtcPickleRRtImportErrorRt	NameErrorRXRRQRPt__all__(((s</usr/lib/python2.7/dist-packages/twisted/persisted/dirdbm.pyt<module>s"


ÿ"

Youez - 2016 - github.com/yon3zu
LinuXploit