def add(self, section, name, value):
# Where are we going to store the database file.
path_obj = path.path()
path_obj.fromstr(self.database_dir)
path_obj.add(section)
path_obj.add(name)
# The database file itself.
entry = path.path()
entry.fromstr(path_obj.tostr())
entry.add("data")
# Make the directoies.
os.makedirs(path_obj.tostr(), exist_ok = True)
# And write the value.
with open(entry.tostr(), 'w') as file:
file.write(value)
评论列表
文章目录