Files
vollerei/vollerei/common/configfile.py
tretrauit 25ca6cf2cb feat: implement configfile
Basically still ConfigParser
2023-06-26 17:22:11 +07:00

16 lines
334 B
Python

from configparser import ConfigParser
from pathlib import Path
class ConfigFile(ConfigParser):
path: Path
def __init__(self, path, **kwargs):
super().__init__(**kwargs)
self.path = Path(path)
self.read(self.path)
def save(self):
with self.path.open("w") as f:
self.write(f)