# 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
            if delkey:
                self._really_delitem(delkey)
        self.db.reorganize()

    @classmethod
    def encode_record(cls, value):
        values = [cls.this_version]
        values.extend(["%s" % getattr(value, x) for x in cls.fields])
        return ",".join(values)

    @classmethod
    def decode_record(cls, s):
        try:
            s = s.decode("utf8")
        except UnicodeError:
            raise StandardError("don't know how to handle db value %s" %
                                repr(s))
        parts = s.split(',')
        version = parts[0]
        if len(parts) == 3:
            dispatch = cls.decode_record_0
        elif version == '1':
            dispatch = cls.decode_record_1
        else:
            raise StandardError("don't know how to handle db value %s" %
                                repr(s))
        return dispatch(s)

    @staticmethod
    def decode_record_0(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

            if delkey:
                self._really_delitem(delkey)
        self.db.reorganize()

    @classmethod
    def encode_record(cls, value):
        values = [cls.this_version]
        values.extend(["%s" % getattr(value, x) for x in cls.fields])
        return ",".join(values)

    @classmethod
    def decode_record(cls, s):
        try:
            s = s.decode("utf8")
        except UnicodeError:
            raise StandardError("don't know how to handle db value %s" %
                                repr(s))
        parts = s.split(',')
        version = parts[0]
        if len(parts) == 3:
            dispatch = cls.decode_record_0
        elif version == '1':
            dispatch = cls.decode_record_1
        else:
            raise StandardError("don't know how to handle db value %s" %
                                repr(s))
        return dispatch(s)

    @staticmethod
    def decode_record_0(s):

        r = Record()