def make_db(db_path): makepdir(os.path.dirname(db_path)) base = shelve.open(db_path) handle = DictProxy(base) atexit.register(handle.close) return handle
def __init__(self, wd=None, languages=[]): languages = [lang(context = self) for lang in languages] self.languages = languages if wd == None: wd = mkdtemp() self.wd = wd self.root_dir = wd makepdir(self.wd) makepdir(self.root_dir) self.fsm = FileSetManager(self) self.registered = False