b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / bsddb /
Filename/usr/lib64/python2.6/bsddb/dbshelve.pyc
Size12.67 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 09:45
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
ñ� ]c@sWdZddkZddkZddkZeiddjZeo ddUn
ddkZeid djo7eiZeid djo
d�Zq¶d �ZndZd
�Zydd k l
Z
Wn&e j
od dd
��YZ
nXei dei
ddd�Zdeifd��YZde
fd��YZddd��YZdS(sNManage shelves of pickled objects using bsddb database files for the
storage.
iÿÿÿÿNiisfrom . import dbiicCsti||�S(N(tcPickletdumps(tobjecttprotocol((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt_dumps1scCsti|d|�S(NR(RR(RR((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR4scCsti|d|�S(Ntbin(RR(RR((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR9s(t DictMixinRcBseZRS((t__name__t
__module__(((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRAsi°cCsÞt|�td�jo�|}|djo
ti}qµ|djo
d}qµ|djo
ti}qµ|djo
ti}qµ|djotitiB}qµtid�nt|�}|i|||||�|S( s(
A simple factory function for compatibility with the standard
shleve.py module. It can be used like this, where key is a string
and data is a pickleable object:

from bsddb import dbshelve
db = dbshelve.open(filename)

db[key] = data

db.close()
ttrtrwitwtctnsJflags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags(ttypetdbt DB_RDONLYt DB_CREATEt DB_TRUNCATEtDBErrortDBShelftopen(tfilenametflagstmodetfiletypetdbenvtdbnametsflagtd((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRFs 








 t
DBShelveErrorcBseZRS((RR(((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRisRcBsõeZdZdd�Zd�Zd�Zd�Zd�Zd�Z d�Z
dd�Z d �Z d
�Z
d �Zdd �Zdd
�Zdd�Zdd�Zdd�Zd�Zddd�Zddd�Zddd�Zdd�ZRS(s�A shelf to hold pickled objects, built upon a bsddb DB object. It
automatically pickles/unpickles data objects going to/from the DB.
cCs<ti|�|_t|_to
t|_n
d|_dS(Ni(RtDBtTruet_closedtHIGHEST_PROTOCOLR(tselfR((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt__init__ps
 
cCs|i�dS(N(tclose(R$((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt__del__yscCst|i|�S(sTMany methods we can just pass through to the DB object.
(See below)
(tgetattrR(R$tname((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt __getattr__}scCs
t|i�S(N(tlenR(R$((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt__len__�scCs|i|}ti|�S(N(RRtloads(R$tkeytdata((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt __getitem__�s
cCs#t||i�}||i|<dS(N(RRR(R$R.tvalueR/((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt __setitem__�scCs|i|=dS(N(R(R$R.((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt __delitem__�scCs/|dj o|ii|�S|ii�SdS(N(tNoneRtkeys(R$ttxn((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR5�s
cOs |ii||�t|_dS(N(RRtFalseR"(R$targstkwargs((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR scOs |ii||�t|_dS(N(RR&R!R"(R$R8R9((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR&¥scCs3|iodt|�Stt|i���SdS(Ns<DBShelf @ 0x%x - closed>(R"tidtreprtdictt iteritems(R$((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt__repr__ªs
cCso|dj o|ii|�}n|ii�}g}x0|D](\}}|i|ti|�f�q?W|S(N(R4RtitemstappendRR-(R$R6R?tnewitemstktv((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR?±s
  cCsB|dj o|ii|�}n|ii�}tti|�S(N(R4RtvaluestmapRR-(R$R6RD((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRD¼s
cCs%t||i�}|ii||�S(N(RRRR@(R$R1R6R/((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt__appendÇscCs7|i�tijo|i|d|�Std�dS(NR6sOappend() only supported when dbshelve opened with filetype=dbshelve.db.DB_RECNO(tget_typeRtDB_RECNOt_DBShelf__appendR(R$R1R6((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR@ËsicCs"|d�}|ii|||�S(NcSs\tiddjpt|t�oti|�}ntit|d��}|||�S(Niis iso8859-1(tsyst version_infot
isinstancetbytesRR-(tpriKeytpriDatat realCallbackR/((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt_shelf_callbackÒs$(Rt associate(R$t secondaryDBtcallbackRRQ((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRRÑs cOsM|ii||�}yti|�SWn tttifj
o|SXdS(N(RtgetRR-tEOFErrort TypeErrortUnpicklingError(R$R8tkwR/((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRUÞs
cCs:t||i�}|ii||||�}ti|�S(N(RRRRURR-(R$R.R1R6RR/((s&/usr/lib64/python2.6/bsddb/dbshelve.pytget_bothêscCs+t|ii||��}|i|_|S(N(t
DBShelfCursorRtcursorR(R$R6RR
((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR\ðs cCs+t||i�}|ii||||�S(N(RRRtput(R$R.R1R6RR/((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR]öscCs
t�dS(N(tNotImplementedError(R$t
cursorListR((s&/usr/lib64/python2.6/bsddb/dbshelve.pytjoinûsN(RRt__doc__R4R%R'R*R,R0R2R3R5RR&R>R?RDRIR@RRRURZR\R]R`(((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRls, 
         
R[cBseZdZd�Zd�Zd�Zdd�Zdd�Zd�Zd�Z d �Z
d
�Z dd �Z dd �Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZd�ZRS(s
cCs
||_dS(N(tdbc(R$R\((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR% scCs|i�dS(N(R&(R$((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR'scCst|i|�S(sHSome methods we can just pass through to the cursor object. (See below)(R(Rb(R$R)((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR*sicCs(t|ii|��}|i|_|S(N(R[RbtdupR(R$RR
((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRcs cCs(t||i�}|ii|||�S(N(RRRbR](R$R.R1RR/((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR] scGs-t|�}t|d|�}||�dS(Nsget_%d(R+R((R$R8tcounttmethod((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRU%s cCs|ii|�}|i|�S(N(RbRUt_extract(R$Rtrec((s&/usr/lib64/python2.6/bsddb/dbshelve.pytget_1*scCs"|ii||�}|i|�S(N(RbRURf(R$R.RRg((s&/usr/lib64/python2.6/bsddb/dbshelve.pytget_2.scCs4t||i�}|ii||�}|i|�S(N(RRRbRURf(R$R.R1RR/Rg((s&/usr/lib64/python2.6/bsddb/dbshelve.pytget_32scCs|i|tiB�S(N(RhRt
DB_CURRENT(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pytcurrent8scCs|i|tiB�S(N(RhRtDB_FIRST(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pytfirst9scCs|i|tiB�S(N(RhRtDB_LAST(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pytlast:scCs|i|tiB�S(N(RhRtDB_NEXT(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pytnext;scCs|i|tiB�S(N(RhRtDB_PREV(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pytprev<scCs|i|tiB�S(N(RhRt
DB_CONSUME(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pytconsume=scCs|i|tiB�S(N(RhRt DB_NEXT_DUP(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pytnext_dup>scCs|i|tiB�S(N(RhRt
DB_NEXT_NODUP(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt
next_nodup?scCs|i|tiB�S(N(RhRt
DB_PREV_NODUP(R$R((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt
prev_nodup@scCs4t||i�}|ii||�}|i|�S(N(RRRbRZRf(R$R.R1RR/Rg((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRZCscCs"|ii||�}|i|�S(N(RbtsetRf(R$R.RRg((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR}IscCs"|ii||�}|i|�S(N(Rbt set_rangeRf(R$R.RRg((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR~MscCs"|ii||�}|i|�S(N(Rbt set_recnoRf(R$trecnoRRg((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRQscCsv|djodS|\}}tiddjpt|t�o|ti|�fS|tit|d��fSdS(Niis iso8859-1(R4RJRKRLRMRR-(R$RgR.R/((s&/usr/lib64/python2.6/bsddb/dbshelve.pyRfWs 
 $(RRRaR%R'R*RcR]RURhRiRjRlRnRpRrRtRvRxRzR|RZR}R~Rtset_bothRf(((s&/usr/lib64/python2.6/bsddb/dbshelve.pyR[ s2                      (iii(iii(((RaRRJRKtabsolute_importRR#RR4tUserDictRt ImportErrorRtDB_HASHRRRRR[(((s&/usr/lib64/python2.6/bsddb/dbshelve.pyt<module>s.      

 "�