e-SrSSKrSSKrSSKrSSKrSS/r Sr \ r "SS\RR5rS Sjrg) aA 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') Nerroropenic\rSrSr\r\rSSjrSrSrSr \ r Sr Sr Sr S rS rS rS rS rSrSrSr\rSrSr\rSrSrSrSrg) _Database#cURRU5nX lUS:HUlUS-UlUS-UlUS-UlSUlURU5 URU5 g)Nrs.dirs.dats.bak) _osfsencode_mode _readonly_dirfile_datfile_bakfile_index_create_update)self filebasenamemodeflags ./opt/imh/python3.13/lib/python3.13/dbm/dumb.py__init___Database.__init__0sqxx((6  #+%w. %w. $w.   T TcUS:XaAURURUR4Hn[R"U5 M [ R"URSSS9nUR5 g![ a M]f=f![ a` US;ae[ R"URSSS9nURUR5 SSS5 g!,(df  g=ff=f)Nnr Latin-1encodingcrw) rrrr removeOSError_iorclose_chmod)rrfilenamefs rr_Database._createJs 3;!]]DMM4==IJJx(J  i@A GGI  +:%$--yAQ DMM*BAAA +s;A: B : BB 1C5<C"C5" C1 ,C51C5cSUl0Ul[R"URSSS9nU UHJnUR 5n[ R"U5upEURS5nXPRU'ML SSS5 g!,(df  g=f![ae US;aeURRURSSS9nURUR5 SSS5 g!,(df  g=ff=f)NFr rrr!r#) _modifiedrr&rrrstrip_ast literal_evalencoder%r()rrr*linekeypos_and_siz_pairs rr_Database._update]s  8i@AD;;=D,0,=,=d,C)C**Y/C'7KK$   +:%t}}cIF! DMM*GFFF +s5 BAB  B6D C9/D 9 D D D cURbUR(dgURRUR5 URR URUR5 URRURSSS9nURUR5 URR5H/up#URS5<SU<S3nURU5 M1 SSS5 SUlg![ a Nf=f![ a Nf=f!,(df  N6=f)Nr#rr,  F)rr-r unlinkrr%renamerr&rr(itemsdecodewrite)rr*r3r4entrys r_commit_Database._commitrs ;; dnn   HHOODMM *  HHOODMM4== 9XX]]4==# ] Ba KK &)-):):)<%'*jj&;=MN *=C       C Bs0%D0D%A)D5 D"!D"% D21D25 Ec4URc [S5egN"DBM object has already been closed)rrrs r _verify_open_Database._verify_opens ;; <= = rcP[U[5(aURS5nUR5 URUup#[ R "URS5nURU5 URU5nSSS5 U$!,(df  W$=f)Nutf-8rb) isinstancestrr1rErr&rrseekread)rr3possizr*dats r __getitem___Database.__getitem__s c3  **W%C ;;s# XXdmmT *a FF3K&&+C+ + * s )#B B%cn[R"URS5nURSS5 [ UR 55nU[ -S- [ -[ -nURSXC- -5 UnURU5 SSS5 W[U54$!,(df  N=f)Nrb+r) r&rrrLinttell _BLOCKSIZEr=len)rvalr*rNnposs r_addval_Database._addvals XXdmmU +q FF1aLaffh-C:%)j8JFD GGE48$ %C GGCL ,SX, +s A/B&& B4c[R"URS5nURU5 UR U5 SSS5 U[ U54$!,(df  N=f)NrT)r&rrrLr=r[)rrNr\r*s r_setval_Database._setvalsJ XXdmmU +q FF3K GGCL,SX, +s #A A(cX RU'[R"URSSS9nUR UR5 UR UR S5<SU<S35 SSS5 g!,(df  g=f)Narrr7r8)rr&rrr(r=r<)rr3r4r*s r_addkey_Database._addkeys[+ C XXdmmS9 = KK & GG#**Y"79IJ K> = =s AA<< B cUR(a [S5e[U[5(aUR S5nO&[U[ [ 45(d [S5e[U[5(aUR S5nO&[U[ [ 45(d [S5eUR5 SUl XR;a!URXRU55 gURUup4U[-S- [-n[U5[-S- [-nXe::aURX25URU'gURU5URU'g)N'The database is opened for reading onlyrHzkeys must be bytes or stringszvalues must be bytes or stringsTrV)r rrJrKr1bytes bytearray TypeErrorrEr-rrer^rZr[ra)rr3r\rNrO oldblocks newblockss r __setitem___Database.__setitem__s- >>AB B c3  **W%CC%!344;< < c3  **W%CC%!344=> >  kk ! LLll3/ 0{{3'HCz)A-*>AB B c3  **W%C  KK  rcb[UR5$![a [S5Sef=frB)listrrkrrDs rkeys_Database.keys6 H $ $ H<=4 G H.cUR5 URR5Vs/sHoX4PM sn$s snfN)rErrvrqs rr;_Database.itemss: ,0KK,<,<,>?,>Sdi ,>???s?c[U[5(aURS5nXR;$![a URc [ S5Seef=f)NrHrC)rJrKr1rrkrrqs r __contains___Database.__contains__sY c3  **W%C ++% % {{"@AtK  s 6%Acb[UR5$![a [S5Sef=frB)iterrrkrrDs riterkeys_Database.iterkeysrxrycb[UR5$![a [S5Sef=frB)r[rrkrrDs r__len___Database.__len__ s6 Ht{{# # H<=4 G HrycUR5 S=Ul=Ul=UlUlg!S=Ul=Ul=UlUlf=fr{)r?rrrrrDs rr'_Database.closesJ O LLNJN NDK N$- N$-$-$ NDK N$- N$-$-s /A cNURRXR5 gr{)r chmodr )rfiles rr(_Database._chmods tZZ(rcU$r{rDs r __enter___Database.__enter__s rc$UR5 gr{)r')rargss r__exit___Database.__exit__!s  r)rrrrr r-r N)r")__name__ __module__ __qualname____firstlineno__r r&rrrr?syncrErQr^rarernrrrvr;r~r__iter__rr'__del__r(rr__static_attributes__rrrrr#s C C4&8*4 D>L 5J H @ H HH O G)rrc[R"S5n[R"U5 X#)-nUS;a [S5e[ XUS9$![a N'f=f)a!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, supports only the semantics of 'c' and 'n' values. Other values will default to the semantics of 'c' value: the database will 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 0o666 (and will be modified by the prevailing umask). r)r r#r"rz)Flag must be one of 'r', 'w', 'c', or 'n')r)r umaskAttributeError ValueErrorr)rrrums rrr%s`  YYq\ " s| ''DEE Td ++    s,A AA)r"i)__doc__astr/ior&osr collections.abc collections__all__rZr%rabcMutableMappingrrrrrrsJ. F    ..D,r