
λΛχ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   ?