def __init__(self, base_data_dir, data_name): data_file = os.path.join(base_data_dir, data_name.replace(".", "/")) + ".dp" data_dir = os.path.dirname(data_file) if not os.path.exists(data_dir): os.makedirs(data_dir) if not os.path.exists(data_file): whisper.create(data_file, self.archives) self.data_file = data_file
def purge(self): os.unlink(self.data_file) whisper.create(self.data_file, self.archives)