diff options
author | Raúl Benencia <rul@kalgan.cc> | 2012-10-03 19:46:06 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2012-10-03 19:46:06 -0300 |
commit | 9866dfb204b8bdbb5bf341204371a4e4e458a9c4 (patch) | |
tree | 4073e444214359403dee60b5a499642049749590 /lib/config.py | |
parent | 9ca5c7e07f1e5ab4a28c042a72a7f9f29b3426c5 (diff) |
Global refactoring
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 + |