summaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'config.py')
-rw-r--r--config.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/config.py b/config.py
new file mode 100644
index 0000000..88826cb
--- /dev/null
+++ b/config.py
@@ -0,0 +1,19 @@
+try:
+ from configparser import ConfigParser
+except ImportError:
+ from ConfigParser import ConfigParser
+
+class Config(object):
+ def __init__(self, filename = 'config'):
+ self.config_section = 'foo'
+
+ self.config = ConfigParser()
+ self.config.read(filename)
+
+ def get(self, key):
+ return self.config.get(self.config_section, key)
+
+ def getint(self, key):
+ return self.config.getint(self.config_section, key)
+
+config = Config()