aboutsummaryrefslogtreecommitdiffstats
path: root/config.py
diff options
context:
space:
mode:
authornico <nico@magicbroccoli.de>2019-05-29 23:04:22 +0200
committernico <nico@magicbroccoli.de>2019-05-29 23:04:22 +0200
commit8e7ac358a4d0f2149873304361c73870d06f8e18 (patch)
tree6eea6585d90690090381f5c2e5271b3e37d6991e /config.py
parentb5176fd5585262f11d1c5bc866b1cbe9d9b9fa9b (diff)
initial release report feature
Misc + add report directory + add template directory Feature Release + add report feature --report + add basic report template + add feature to use -d/ --domain flag multiple times Optimization + add config.py loading user config * further code optimization * update gitignore file
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..12a41a4
--- /dev/null
+++ b/config.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+import json
+
+# try to read config.json if nonexistent create config.json an populate it
+try:
+ with open("config.json", "r", encoding="utf-8") as f:
+ config = json.load(f)
+
+except FileNotFoundError:
+ with open("config.json", "w", encoding="utf-8") as f:
+ config = {
+ "name": "",
+ }
+ f.write(json.dumps(config))
+
+
+class Config(object):
+ """extract secret key to use for the webserver"""
+ name = config["name"]