dbi.py 700 B

123456789101112131415161718192021222324
  1. """
  2. Skeleton replacement for removed dbi module.
  3. Use of objects created by this module should be replaced with native Python objects.
  4. Dates are now returned as datetime.datetime objects, but will still accept PyTime
  5. objects also.
  6. Raw data for binary fields should be passed as buffer objects for Python 2.x,
  7. and memoryview objects in Py3k.
  8. """
  9. import warnings
  10. warnings.warn(
  11. "dbi module is obsolete, code should now use native python datetime and buffer/memoryview objects",
  12. DeprecationWarning)
  13. import datetime
  14. dbDate = dbiDate = datetime.datetime
  15. try:
  16. dbRaw = dbiRaw = buffer
  17. except NameError:
  18. dbRaw = dbiRaw = memoryview
  19. # type names are still exported by odbc module
  20. from odbc import *