
]a¸2c      s)     d  Z   d   k Z  d „  Z d S(   s0   Guess which db package to use to open a db file.c   s±    d   yQ  t  |  d d ƒ }  | i ƒ   t  |  d d ƒ }  | i ƒ   d SWn  t j
 o
  n X y  t  |  d ƒ } Wn  t j
 o   t Sn X# | i d ƒ } $ | i ƒ  ' t | ƒ d j o ( d Sn + y , t	 i
 d | ƒ \ } Wn[ - t	 i j
 oI . y / t	 i
 d | ƒ \ } Wn  0 t	 i j
 o 1 d Sn Xn X4 | d	 j o 5 d
 Sn 8 | d j o 9 d Sn < d Sd S(   sg  Guess which db package to use to open a db file.

    Return values:

    - None if the database file can't be read;
    - empty string if the file can be read but can't be recognized
    - the module name (e.g. "dbm" or "gdbm") if recognized.

    Importing the given module may still fail, and opening the
    database using that module may still fail.
    s   .pags   rbs   .dirs   dbmi   s    s   ls   iiÎšWs   gdbmia s   dbhashN(   s   opens   filenames   fs   closes   IOErrors   Nones   reads   ss   lens   structs   unpacks   magics   error(   s   filenames   fs   ss   magics   /usr/lib/python1.4/whichdb.pys   whichdbN(   s   __doc__s   structs   whichdb(    s   /usr/lib/python1.4/whichdb.pys   ?