This repository has been archived on 2023-04-13. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
CloudBot/core/config.py
2013-10-01 19:44:32 +13:00

16 lines
No EOL
330 B
Python
Executable file

import json
import os
class Config(dict):
def __init__(self, name, *args, **kwargs):
self.path = os.path.abspath("{}.json".format(name))
self.update(*args, **kwargs)
def load_config(self):
with open(self.path) as f:
self.update(json.load(f))
def save_config(self):
pass