MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/3/root/proc/2/task/2/root/proc/self/root/usr/lib/python2.4/dumbdbm.pyc
mς
‚=5Dc@sbdZdkZdkZdkZeiZdZeZ	dei
fd„ƒYZddd„ZdS(s­A dumb and slow but simple dbm clone.

For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).

XXX TO DO:

- seems to contain a bug when updating...

- reclaim free space (currently, space once occupied by deleted or expanded
items is never reused)

- support concurrent access (currently, if two processes take turns making
updates, they can mess up the index)

- support efficient access to large databases (currently, the whole index
is read when the database is opened, and some updates rewrite the whole index)

- support opening for read-only (flag = 'm')

Nit	_DatabasecBs­tZeZeZd„Zd„Zd„ZeZd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„ZeZd„Zd„ZeZRS(NcCsͺ||_|tid|_|tid|_|tid|_d|_
yt|idƒ}Wn+t
j
ot|id|iƒ}nX|iƒ|iƒdS(Ntdirtdattbaktrtw(tmodetselft_modetfilebasenamet_ostextsept_dirfilet_datfilet_bakfiletNonet_indext_opentftIOErrortcloset_update(RR	RR((t/usr/lib/python2.4/dumbdbm.pyt__init__/s		
cCs|h|_yt|iƒ}Wntj
onHXx9|D]1}|iƒ}t|ƒ\}}||i|<q9W|iƒdS(N(RRRRRRtlinetrstriptevaltkeytpos_and_siz_pairR(RRRRR((RRLs	cCsδ|idjodSny|ii|iƒWn|iij
onXy|ii|i|iƒWn|iij
onX|i	|id|i
ƒ}x4|iiƒD]#\}}|id||fƒq―W|iƒdS(NRs%r, %r
(RRRR
tunlinkRterrortrenameRRRRt	iteritemsRRtwriteR(RRRR((Rt_commit\scCsO|i|\}}t|idƒ}|i|ƒ|i	|ƒ}|iƒ|S(Ntrb(RRRtpostsizRR
RtseektreadRR(RRRR%R$R((Rt__getitem__ts

cCsŒt|idƒ}|iddƒt|iƒƒ}|tdtt}|i
d||ƒ|}|i
|ƒ|iƒ|t
|ƒfS(Nsrb+iiit(RRR
RR&tintttellR$t
_BLOCKSIZEtnposR!tvalRtlen(RR.RR$R-((Rt_addval€s

cCsFt|idƒ}|i|ƒ|i|ƒ|iƒ|t	|ƒfS(Nsrb+(
RRR
RR&R$R!R.RR/(RR$R.R((Rt_setvals



cCsJ||i|<t|id|iƒ}|id||fƒ|i	ƒdS(Ntas%r, %r
(
RRRRRRRRR!R(RRRR((Rt_addkey™s
cCsλt|ƒtdƒjot|ƒjnp
td‚n||ijo|i||i|ƒƒn~|i|\}}|t
dt
}t|ƒt
dt
}||jo|i||ƒ|i|<n|i|ƒ|i|<dS(Ntskeys and values must be stringsi(ttypeRR.t	TypeErrorRRR3R0R$R%R,t	oldblocksR/t	newblocksR1(RRR.R%R$R8R7((Rt__setitem__Ÿs0

cCs|i|=|iƒdS(N(RRRR"(RR((Rt__delitem__Ίs
cCs
|iiƒS(N(RRtkeys(R((RR;ΓscCs
||ijS(N(RRR(RR((Rthas_keyΖscCs
||ijS(N(RRR(RR((Rt__contains__ΙscCs
|iiƒS(N(RRtiterkeys(R((RR>ΜscCs
t|iƒS(N(R/RR(R((Rt__len__ΠscCs,|iƒd|_|_|_|_dS(N(RR"RRR
RR(R((RRΣs
(t__name__t
__module__R
RRRR"tsyncR(R0R1R3R9R:R;R<R=R>t__iter__R?Rt__del__(((RR"s(
						
										iΆcCs
t||ƒS(sτOpen the database file, filename, and return corresponding object.

    The flag argument, used to control how the database is opened in the
    other DBM implementations, is ignored in the dumbdbm module; the
    database is always opened for update, and will be created if it does
    not exist.

    The optional mode argument is the UNIX mode of the file, used only when
    the database has to be created.  It defaults to octal code 0666 (and
    will be modified by the prevailing umask).

    N(RtfileR(REtflagR((RtopenΫs(
t__doc__tosR
t__builtin__tUserDictRGRR,RRt	DictMixinRR(R
RKRRRJRR,RG((Rt?s				Ή