1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00

fiddle with config syntax, add disabled new plugin for quiz

This commit is contained in:
Thorsten
2016-01-28 19:15:48 +01:00
parent 113b9d94b1
commit 6b20f89581
2 changed files with 91 additions and 52 deletions

View File

@@ -13,6 +13,8 @@ import json
import logging
import os
import sys
from contextlib import contextmanager
from fasteners import interprocess_locked
from configobj import ConfigObj
from validate import Validator
@@ -99,3 +101,11 @@ def runtimeconf_deepget(key, default=None):
if value is None:
break
return value
@contextmanager
def plugin_config(name):
cfg = runtimeconf_deepget('plugins.{}'.format(name), {})
yield cfg
runtime_config_store['plugins'][name] = cfg
runtimeconf_persist()