config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/bsddb/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/bsddb/__init__.pyc

³ò
h”Rc@sîdZySedjo&ddkZeZddklZnddkZddklZWn,ej
o ddk	Z	e	i
e=‚nXeZZei
Z
eiZddk	Z	ddkZe	idjo(ddkZddklZddUnddd	„ƒYZd
efd„ƒYZdd
ddddddd„Zdd
ddddddd„Zdd
ddddddddd„
Zd„Zd„Zy3ddkZ[eiƒdjo
de_nWnej
ode_nXdS(s¾Support for BerkeleyDB 3.3 through 4.4 with a simple interface.

For the full featured object oriented interface use the bsddb.db module
instead.  It mirrors the Sleepycat BerkeleyDB C API.
tbsddb3iÿÿÿÿN(tDeadlockWraps2.3(trefs&

class _iter_mixin(UserDict.DictMixin):
    def _make_iter_cursor(self):
        cur = _DeadlockWrap(self.db.cursor)
        key = id(cur)
        self._cursor_refs[key] = ref(cur, self._gen_cref_cleaner(key))
        return cur

    def _gen_cref_cleaner(self, key):
        # use generate the function for the weakref callback here
        # to ensure that we do not hold a strict reference to cur
        # in the callback.
        return lambda ref: self._cursor_refs.pop(key, None)

    def __iter__(self):
        try:
            cur = self._make_iter_cursor()

            # FIXME-20031102-greg: race condition.  cursor could
            # be closed by another thread before this call.

            # since we're only returning keys, we call the cursor
            # methods with flags=0, dlen=0, dofs=0
            key = _DeadlockWrap(cur.first, 0,0,0)[0]
            yield key

            next = cur.next
            while 1:
                try:
                    key = _DeadlockWrap(next, 0,0,0)[0]
                    yield key
                except _bsddb.DBCursorClosedError:
                    cur = self._make_iter_cursor()
                    # FIXME-20031101-greg: race condition.  cursor could
                    # be closed by another thread before this call.
                    _DeadlockWrap(cur.set, key,0,0,0)
                    next = cur.next
        except _bsddb.DBNotFoundError:
            return
        except _bsddb.DBCursorClosedError:
            # the database was modified during iteration.  abort.
            return

    def iteritems(self):
        if not self.db:
            return
        try:
            cur = self._make_iter_cursor()

            # FIXME-20031102-greg: race condition.  cursor could
            # be closed by another thread before this call.

            kv = _DeadlockWrap(cur.first)
            key = kv[0]
            yield kv

            next = cur.next
            while 1:
                try:
                    kv = _DeadlockWrap(next)
                    key = kv[0]
                    yield kv
                except _bsddb.DBCursorClosedError:
                    cur = self._make_iter_cursor()
                    # FIXME-20031101-greg: race condition.  cursor could
                    # be closed by another thread before this call.
                    _DeadlockWrap(cur.set, key,0,0,0)
                    next = cur.next
        except _bsddb.DBNotFoundError:
            return
        except _bsddb.DBCursorClosedError:
            # the database was modified during iteration.  abort.
            return
t_iter_mixincBseZRS((t__name__t
__module__(((s*/usr/local/lib/python2.5/bsddb/__init__.pyR–st
_DBWithCursorcBs¼eZdZd„Zd„Zd„Zdd„Zd„Zd„Zd„Z	d	„Z
d
„Zd„Zd„Z
d
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s˜
    A simple wrapper around DB that makes it look like the bsddbobject in
    the old module.  It uses a cursor as needed to provide DB traversal.
    cCs8||_|iidƒd|_d|_h|_dS(Ni(tdbtset_get_returns_nonetNonetdbct
saved_dbc_keyt_cursor_refs(tselfR((s*/usr/local/lib/python2.5/bsddb/__init__.pyt__init__žs
	
		cCs|iƒdS(N(tclose(R
((s*/usr/local/lib/python2.5/bsddb/__init__.pyt__del__´scCs`|idjoLt|iiƒ|_|idj	o#t|ii|iƒd|_q\ndS(N(R
R	t
_DeadlockWrapRtcursorRtset(R
((s*/usr/local/lib/python2.5/bsddb/__init__.pyt_checkCursor·s
icCs¼|iom|i}d|_|o@y#t|idddƒd|_Wqctij
oqcXnt|iƒ~nx>|ii	ƒD]-}|ƒ}|dj	ot|iƒq‡q‡WdS(Ni(
R
R	RtcurrentRRtDBErrorRRtvalues(R
tsavetctcref((s*/usr/local/lib/python2.5/bsddb/__init__.pyt
_closeCursorsÂs
		#	
	
cCs!|idjo
td‚ndS(Ns$BSDDB object has already been closed(RR	terror(R
((s*/usr/local/lib/python2.5/bsddb/__init__.pyt
_checkOpenÒscCs
|idj	S(N(RR	(R
((s*/usr/local/lib/python2.5/bsddb/__init__.pytisOpenÖscsˆiƒt‡fd†ƒS(Ncs
tˆiƒS((tlenR((R
(s*/usr/local/lib/python2.5/bsddb/__init__.pyt<lambda>Ûs(RR(R
((R
s*/usr/local/lib/python2.5/bsddb/__init__.pyt__len__Ùs
cs ˆiƒt‡‡fd†ƒS(NcsˆiˆS((R((R
tkey(s*/usr/local/lib/python2.5/bsddb/__init__.pyR ßs(RR(R
R"((R
R"s*/usr/local/lib/python2.5/bsddb/__init__.pyt__getitem__Ýs
cs7ˆiƒˆiƒ‡‡‡fd†}t|ƒdS(Ncsˆˆiˆ<dS(N(R((R
tvalueR"(s*/usr/local/lib/python2.5/bsddb/__init__.pytwrapFäs(RRR(R
R"R$R%((R
R$R"s*/usr/local/lib/python2.5/bsddb/__init__.pyt__setitem__ás

cs4ˆiƒˆiƒ‡‡fd†}t|ƒdS(Ncsˆiˆ=dS(N(R((R
R"(s*/usr/local/lib/python2.5/bsddb/__init__.pyR%ës(RRR(R
R"R%((R
R"s*/usr/local/lib/python2.5/bsddb/__init__.pyt__delitem__ès

cCsv|iddƒ|idj	ot|iiƒnd}|idj	ot|iiƒ}nd|_d|_|S(NRi(RR
R	RRR(R
tv((s*/usr/local/lib/python2.5/bsddb/__init__.pyRïs		cCs|iƒt|iiƒS(N(RRRtkeys(R
((s*/usr/local/lib/python2.5/bsddb/__init__.pyR)ús
cCs|iƒt|ii|ƒS(N(RRRthas_key(R
R"((s*/usr/local/lib/python2.5/bsddb/__init__.pyR*þs
cCs'|iƒ|iƒt|ii|ƒS(N(RRRR
t	set_range(R
R"((s*/usr/local/lib/python2.5/bsddb/__init__.pytset_locations

cCs*|iƒ|iƒt|iiƒ}|S(N(RRRR
tnext(R
trv((s*/usr/local/lib/python2.5/bsddb/__init__.pyR-s

cCs*|iƒ|iƒt|iiƒ}|S(N(RRRR
tprev(R
R.((s*/usr/local/lib/python2.5/bsddb/__init__.pytprevious
s

cCs3|iƒd|_|iƒt|iiƒ}|S(N(RR	RRRR
tfirst(R
R.((s*/usr/local/lib/python2.5/bsddb/__init__.pyR1s

	
cCs3|iƒd|_|iƒt|iiƒ}|S(N(RR	RRRR
tlast(R
R.((s*/usr/local/lib/python2.5/bsddb/__init__.pyR2s

	
cCs|iƒt|iiƒS(N(RRRtsync(R
((s*/usr/local/lib/python2.5/bsddb/__init__.pyR3#s
(RRt__doc__RRRRRRR!R#R&R'RR)R*R,R-R0R1R2R3(((s*/usr/local/lib/python2.5/bsddb/__init__.pyR™s(																	Ri¶ic	CsÒt||ƒ}	t|ƒ}
ti|
ƒ}|i|ƒ|dj	o|i|ƒn|dj	o|i|ƒn|dj	o|i|ƒn|dj	o|i	|ƒn|i
|ti|	|ƒt|ƒS(N(
t
_checkflagt
_openDBEnvRtDBt	set_flagsR	tset_pagesizet
set_lordert
set_h_ffactortset_h_nelemtopentDB_HASHR(tfiletflagtmodetpgsizetffactortnelemt	cachesizetlorderthflagstflagstetd((s*/usr/local/lib/python2.5/bsddb/__init__.pythashopen+s




c	CsÒt||ƒ}	t|ƒ}
ti|
ƒ}|dj	o|i|ƒn|dj	o|i|ƒn|i|ƒ|dj	o|i|ƒn|dj	o|i	|ƒn|i
|ti|	|ƒt|ƒS(N(
R5R6RR7R	R9R:R8t
set_bt_minkeyt
set_bt_maxkeyR=tDB_BTREER(R?R@RAtbtflagsREt
maxkeypaget
minkeypageRBRFRHRIRJ((s*/usr/local/lib/python2.5/bsddb/__init__.pytbtopen;s




cCst||ƒ}t|ƒ}ti|ƒ}
|dj	o|
i|ƒn|dj	o|
i|ƒn|
i|ƒ|dj	o|
i|ƒn|dj	o|
i	|ƒn|	dj	o|
i
|	ƒn|
dj	o|
i|
ƒn|
i|ti
||ƒt|
ƒS(N(R5R6RR7R	R9R:R8tset_re_delimt
set_re_lent
set_re_sourcet
set_re_padR=tDB_RECNOR(R?R@RAtrnflagsRERBRFtrlentdelimtsourcetpadRHRIRJ((s*/usr/local/lib/python2.5/bsddb/__init__.pytrnopenMs$






cCsŠtiƒ}|dj	o.|djo|id|ƒqGtd‚n|itiƒ|idtiti	Bti
BtiBtiBƒ|S(NiPiscachesize must be >= 20480t.(
RtDBEnvR	t
set_cachesizeRt
set_lk_detecttDB_LOCK_DEFAULTR=t
DB_PRIVATEt	DB_CREATEt	DB_THREADtDB_INIT_LOCKt
DB_INIT_MPOOL(RERI((s*/usr/local/lib/python2.5/bsddb/__init__.pyR6`s


/cCsÄ|djo
ti}n |djo
d}n‰|djo
ti}no|djo
ti}nU|djo>ti}|dj	o$tii|ƒoti|ƒq¹n
td‚|ti	BS(NtrtrwitwRtns+flags should be one of 'r', 'w', 'c' or 'n'(
Rt	DB_RDONLYRdR	tostpathtisfiletunlinkRRe(R@R?RH((s*/usr/local/lib/python2.5/bsddb/__init__.pyR5ks








	 	i((iii(R4Rt_pybsddbt_bsddbtbsddb3.dbutilsRRt
bsddb.dbutilstImportErrortsystmodulesRt_dbt__version__RRRmtversiontUserDicttweakrefRRRR	RKRRR]R6R5tthreadRe(((s*/usr/local/lib/python2.5/bsddb/__init__.pys<module>(sL


		J’		

Man Man