diff options
Diffstat (limited to 'lib/config.py')
-rw-r--r-- | lib/config.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/config.py b/lib/config.py new file mode 100644 index 0000000..f4fab70 --- /dev/null +++ b/lib/config.py @@ -0,0 +1,16 @@ +import configparser + +class Config: + _instance = None + + def __new__(cls, *args, **kwargs): + if not cls._instance: + cls._instance = super(Config, cls).__new__( + cls, *args, **kwargs) + + return cls._instance + + def __init__(self): + self.parser = configparser.ConfigParser() + self.parser.read('pywhoisd.conf') # Find a way not to hardcode this + |