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:22:59 +13:00

17 lines
No EOL
331 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 reload(self):
with open(self.path) as f:
self = json.load(f)
print self
def save(self):
pass