# Path: pyzor/engines/common.py
# class DatabaseError(Exception):
# class Record(object):
# class BaseEngine(object):
#     def __init__(self, r_count=0, wl_count=0, r_entered=None,
#                  r_updated=None, wl_entered=None, wl_updated=None):
#     def wl_increment(self):
#     def r_increment(self):
#     def r_update(self):
#     def wl_update(self):
#     def __iter__(self):
#     def iteritems(self):
#     def items(self):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def report(self, keys):
#     def whitelist(self, keys):
#     def get_prefork_connections(cls, fn, mode, max_age=None):


    import gdbm as gdbm
        import dbm.gnu as gdbm
import time
import logging
import datetime
import threading
from pyzor.engines.common import Record, DBHandle, BaseEngine
"""Gdbm database engine."""

try:
    _has_gdbm = True
except ImportError:
    try:
        _has_gdbm = True
    except ImportError:
        _has_gdbm = False




def _dt_decode(datetime_str):
    """Decode a string into a datetime object."""
    if datetime_str == 'None':
        return None
    try:
        return datetime.datetime.strptime(datetime_str, "%Y-%m-%d %H:%M:%S.%f")
    except ValueError:
        return datetime.datetime.strptime(datetime_str, "%Y-%m-%d %H:%M:%S")



# Path: pyzor/engines/common.py
# class DatabaseError(Exception):
# class Record(object):
# class BaseEngine(object):
#     def __init__(self, r_count=0, wl_count=0, r_entered=None,
#                  r_updated=None, wl_entered=None, wl_updated=None):
#     def wl_increment(self):
#     def r_increment(self):
#     def r_update(self):
#     def wl_update(self):
#     def __iter__(self):
#     def iteritems(self):
#     def items(self):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def report(self, keys):
#     def whitelist(self, keys):
#     def get_prefork_connections(cls, fn, mode, max_age=None):


# Path: pyzor/engines/gdbm_.py
    import gdbm as gdbm
        import dbm.gnu as gdbm
import time
import logging
import datetime
import threading
from pyzor.engines.common import Record, DBHandle, BaseEngine

"""Gdbm database engine."""

try:
    _has_gdbm = True
except ImportError:
    try:
        _has_gdbm = True
    except ImportError:
        _has_gdbm = False




def _dt_decode(datetime_str):
    """Decode a string into a datetime object."""
    if datetime_str == 'None':
        return None
    try:
        return datetime.datetime.strptime(datetime_str, "%Y-%m-%d %H:%M:%S.%f")
    except ValueError:
        return datetime.datetime.strptime(datetime_str, "%Y-%m-%d %H:%M:%S")



class GdbmDBHandle(BaseEngine):