diff options
author | Anish Athalye <aathalye@me.com> | 2014-03-19 23:07:30 -0400 |
---|---|---|
committer | Anish Athalye <aathalye@me.com> | 2014-03-20 18:57:56 -0400 |
commit | 60a560e97699a1d9a4320b8e787a50b1a9a7734d (patch) | |
tree | 573ce63c2a49a278af49c0cc6542bfe3b89cf572 /dotbot/config.py |
Initial commit
Diffstat (limited to 'dotbot/config.py')
-rw-r--r-- | dotbot/config.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dotbot/config.py b/dotbot/config.py new file mode 100644 index 0000000..79b735c --- /dev/null +++ b/dotbot/config.py @@ -0,0 +1,19 @@ +import json + +class ConfigReader(object): + def __init__(self, config_file_path): + self._config = self._read(config_file_path) + + def _read(self, config_file_path): + try: + with open(config_file_path) as fin: + data = json.load(fin) + return data + except Exception: + raise ReadingError('Could not read config file') + + def get_config(self): + return self._config + +class ReadingError(Exception): + pass |