# this is the base class, has base functionality and find node, no key-value mappings
class KhashmirBase(protocol.Factory):
- __slots__ = ('listener', 'node', 'table', 'store', 'app', 'last', 'protocol')
_Node = KNodeBase
def __init__(self, host, port, db='khashmir.db'):
self.setup(host, port, db)
#self.store.autocommit = 0
except:
import traceback
- raise KhashmirDBExcept, "Couldn't open DB", traceback.exc_traceback
+ raise KhashmirDBExcept, "Couldn't open DB", traceback.format_exc()
def _createNewDB(self, db):
self.store = sqlite.connect(db=db)
from const import reactor, NULL_ID
-class IDChecker:
- def __init__(id):
- self.id = id
-
class KNodeBase(Node):
def checkSender(self, dict):
try:
self.invalidateNode(n)
class KBucket:
- __slots__ = ('min', 'max', 'lastAccessed')
def __init__(self, contents, min, max):
self.l = contents
self.min = min