From 9866dfb204b8bdbb5bf341204371a4e4e458a9c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Wed, 3 Oct 2012 19:46:06 -0300 Subject: Global refactoring --- lib/config.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/config.py (limited to 'lib/config.py') 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 + -- cgit v1.2.3