Skip to content
Snippets Groups Projects
Verified Commit 39e447a3 authored by magicfelix's avatar magicfelix
Browse files

Interactive setup

parent 06e8da53
No related branches found
No related tags found
No related merge requests found
...@@ -2,11 +2,18 @@ from json import dumps ...@@ -2,11 +2,18 @@ from json import dumps
conf = { conf = {
"title": "Example election", "title": "Example election",
"min": 0, "min": 1,
"max": 1, "max": 1,
"stats_url": "https://prognos.example.org", "stats_url": "https://prognos.example.org",
} }
for key in conf:
value = input(key + " [" + str(conf[key]) + "]: ")
if value != "":
if value.isdigit():
value = int(value)
conf[key] = value
cfg_file = open("config.json", "w") cfg_file = open("config.json", "w")
cfg_file.write(dumps(conf)) cfg_file.write(dumps(conf))
cfg_file.close() cfg_file.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment