summaryrefslogtreecommitdiffstats
path: root/src/ogConfig.py
diff options
context:
space:
mode:
authorAlvaro Neira Ayuso <aneira@soleta.eu>2019-12-12 11:50:46 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commit29fe301ec82a657ee889411ad032af9909ceb6a4 (patch)
tree2979c65a5a0fb4cfb9c8424f2e905b595977cbe2 /src/ogConfig.py
parente3d707cfb3dad78388663339af9412e0697b358c (diff)
Create new ogClient
This commit init the new ogClient. The new ogClient has support for configuring and for connecting with the ogAdminServer.
Diffstat (limited to 'src/ogConfig.py')
-rw-r--r--src/ogConfig.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/ogConfig.py b/src/ogConfig.py
new file mode 100644
index 0000000..84d3346
--- /dev/null
+++ b/src/ogConfig.py
@@ -0,0 +1,24 @@
+import configparser
+
+class ogConfig:
+ def __init__(self):
+ self.parser = configparser.ConfigParser()
+
+ def parserFile(self, path):
+ self.parser.read(path)
+ if len(self.parser.sections()) == 0:
+ return False
+
+ return True
+
+ def getSections(self):
+ return self.parser.sections()
+
+ def getContainsSection(self, section):
+ return section in self.parser
+
+ def getValueSection(self, section, key):
+ if (not self.getContainsSection(section)):
+ return ''
+
+ return self.parser[section][key]