home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 July / maximum-cd-2011-07.iso / DiscContents / LibO_3.3.2_Win_x86_install_multi.exe / libreoffice1.cab / dbhash.py < prev    next >
Encoding:
Python Source  |  2011-03-15  |  524 b   |  20 lines

  1. """Provide a (g)dbm-compatible interface to bsddb.hashopen."""
  2.  
  3. import sys
  4. if sys.py3kwarning:
  5.     import warnings
  6.     warnings.warnpy3k("in 3.x, dbhash has been removed", DeprecationWarning, 2)
  7. try:
  8.     import bsddb
  9. except ImportError:
  10.     # prevent a second import of this module from spuriously succeeding
  11.     del sys.modules[__name__]
  12.     raise
  13.  
  14. __all__ = ["error","open"]
  15.  
  16. error = bsddb.error                     # Exported for anydbm
  17.  
  18. def open(file, flag = 'r', mode=0666):
  19.     return bsddb.hashopen(file, flag, mode)
  20.