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:
10
config.py
10
config.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user