Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/ |
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 |
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/dumbdbm.pyo |
³ò h”Rc @ sk d Z d d k Z d d k Z d d k Z e i Z d Z e Z d e i f d „ ƒ YZ d d d „ Z d S( 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') iÿÿÿÿNi t _Databasec B s e Z e Z e Z d „ Z d „ Z d „ Z e Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z e Z d „ Z d „ Z e Z RS( c C sª | | _ | t i d | _ | t i d | _ | t i d | _ d | _ y t | i d ƒ } Wn+ t j o t | i d | i ƒ } n X| i ƒ | i ƒ d S( Nt dirt datt bakt rt w( t _modet _ost extsept _dirfilet _datfilet _bakfilet Nonet _indext _opent IOErrort closet _update( t selft filebasenamet modet f( ( s# /usr/local/lib/python2.5/dumbdbm.pyt __init__/ s c C s| h | _ y t | i ƒ } Wn t j o nH Xx9 | D]1 } | i ƒ } t | ƒ \ } } | | i | <q9 W| i ƒ d S( N( R R R R t rstript evalR ( R R t linet keyt pos_and_siz_pair( ( s# /usr/local/lib/python2.5/dumbdbm.pyR L s c C sä | i d j o d Sn y | i i | i ƒ Wn | i i j o n Xy | i i | i | i ƒ Wn | i i j o n X| i | i d | i ƒ } x4 | i i ƒ D]# \ } } | i d | | f ƒ q¯ W| i ƒ d S( NR s %r, %r ( R R R t unlinkR t errort renameR R R t iteritemst writeR ( R R R R ( ( s# /usr/local/lib/python2.5/dumbdbm.pyt _commit\ s c C sO | i | \ } } t | i d ƒ } | i | ƒ | i | ƒ } | i ƒ | S( Nt rb( R R R t seekt readR ( R R t post sizR R ( ( s# /usr/local/lib/python2.5/dumbdbm.pyt __getitem__t s c C sŒ t | i d ƒ } | i d d ƒ t | i ƒ ƒ } | t d t t } | i d | | ƒ | } | i | ƒ | i ƒ | t | ƒ f S( Ns rb+i i i t ( R R R# t intt tellt _BLOCKSIZER R t len( R t valR R% t npos( ( s# /usr/local/lib/python2.5/dumbdbm.pyt _addval€ s c C sF t | i d ƒ } | i | ƒ | i | ƒ | i ƒ | t | ƒ f S( Ns rb+( R R R# R R R, ( R R% R- R ( ( s# /usr/local/lib/python2.5/dumbdbm.pyt _setval s c C sJ | | i | <t | i d | i ƒ } | i d | | f ƒ | i ƒ d S( Nt as %r, %r ( R R R R R R ( R R R R ( ( s# /usr/local/lib/python2.5/dumbdbm.pyt _addkey™ s c C së t | ƒ t d ƒ j o t | ƒ j n p t d ‚ n | | i j o | i | | i | ƒ ƒ n~ | i | \ } } | t d t } t | ƒ t d t } | | j o | i | | ƒ | i | <n | i | ƒ | i | <d S( Nt s keys and values must be stringsi ( t typet TypeErrorR R2 R/ R+ R, R0 ( R R R- R% R&