summaryrefslogtreecommitdiff
path: root/kvmd/application.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-09-26 02:57:24 +0300
committerDevaev Maxim <[email protected]>2018-09-26 02:57:24 +0300
commit81a5311349564a1016c4af2bf18ae872b650e85b (patch)
treed01fd027948494e22ae2c14334b98c1515e5e8a4 /kvmd/application.py
parentf3946f102fc167efdc53c73412b2c0d6ac6c72c5 (diff)
moved kvmd to the root
Diffstat (limited to 'kvmd/application.py')
-rw-r--r--kvmd/application.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/kvmd/application.py b/kvmd/application.py
new file mode 100644
index 00000000..a78c1047
--- /dev/null
+++ b/kvmd/application.py
@@ -0,0 +1,22 @@
+import argparse
+import logging
+import logging.config
+
+from typing import Dict
+
+import yaml
+
+
+# =====
+def init() -> Dict:
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-c", "--config", required=True, metavar="<path>")
+ options = parser.parse_args()
+
+ with open(options.config) as config_file:
+ config = yaml.load(config_file)
+
+ logging.captureWarnings(True)
+ logging.config.dictConfig(config["logging"])
+
+ return config["kvmd"]