File size: 569 Bytes
246df79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import json
from pathlib import Path


class ConfigManager:
    """
    A wrapper file used to abstract Twitter config options.    """

    @staticmethod
    def _get_config(config_path):
        if Path(config_path).is_file() == False:
            raise Exception("The {} config file was not found.".format(config_path))

        with open(config_path) as json_file:
            twitter_config_dict = json.load(json_file)

        return twitter_config_dict

    @staticmethod
    def getTwitterConfig():
        return ConfigManager._get_config("twitterConfig.json")