ÿØÿâ
Path : /opt/alt/python27/lib64/python2.7/ |
Current < : //opt/alt/python27/lib64/python2.7/anydbm.pyo |
� �[ bc @ s� d Z d e f d � � YZ d d d d g Z e g Z d Z xT e D]L Z y e e � Z Wn e k rp qD n Xe s� e Z n e j e j � qD We s� e d e � n e e � Z d d d � Z d S( s� Generic interface to all dbm clones. Instead of import dbm d = dbm.open(file, 'w', 0666) use import anydbm d = anydbm.open(file, 'w') The returned object is a dbhash, gdbm, dbm or dumbdbm object, dependent on the type of database being opened (determined by whichdb module) in the case of an existing dbm. If the dbm does not exist and the create or new flag ('c' or 'n') was specified, the dbm type will be determined by the availability of the modules (tested in the above order). It has the following interface (key and data are strings): d[key] = data # store data at key (may override data at # existing key) data = d[key] # retrieve data at key (raise KeyError if no # such key) del d[key] # delete data stored at key (raises KeyError # if no such key) flag = key in d # true if the key exists list = d.keys() # return a list of all existing keys (slow!) Future versions may change the order in which implementations are tested for existence, and add interfaces to other dbm-like implementations. t errorc B s e Z RS( ( t __name__t __module__( ( ( s+ /opt/alt/python27/lib64/python2.7/anydbm.pyR $ s t dbhasht gdbmt dbmt dumbdbms no dbm clone found; tried %st ri� c C s� d d l m } | | � } | d k rU d | k s@ d | k rI t } qy t d � n$ | d k rm t d � n t | � } | j | | | � S( s� Open or create database at path given by *file*. Optional argument *flag* can be 'r' (default) for read-only access, 'w' for read-write access of an existing database, 'c' for read-write access to a new or existing database, and 'n' for read-write access to a new database. Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it only if it doesn't exist; and 'n' always creates a new database. i����( t whichdbt ct ns# need 'c' or 'n' flag to open new dbt s db type could not be determinedN( R t Nonet _defaultmodR t __import__t open( t filet flagt modeR t resultt mod( ( s+ /opt/alt/python27/lib64/python2.7/anydbm.pyR 9 s N( t __doc__t ExceptionR t _namest _errorsR R t _nameR t _modt ImportErrort appendt tupleR ( ( ( s+ /opt/alt/python27/lib64/python2.7/anydbm.pyt <module>"