def __init__(self, db_path): self.db_path = db_path self.db = shelve.open(self.db_path, 'c') self.lock = threading.Lock() self.stopped = False