summaryrefslogtreecommitdiffstats
path: root/module/web/json_app.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-19 23:10:49 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-19 23:10:49 +0100
commit6eae782f13953dd0ba2bbe1b582cf33fd4d7d90a (patch)
treea7e80bc89b1a523854e1f3e3d9ec945023193212 /module/web/json_app.py
parentpluginmanager cleanup (diff)
downloadpyload-6eae782f13953dd0ba2bbe1b582cf33fd4d7d90a.tar.xz
configparser v2, warning CONFIG will be DELETED.
Diffstat (limited to 'module/web/json_app.py')
-rw-r--r--module/web/json_app.py29
1 files changed, 7 insertions, 22 deletions
diff --git a/module/web/json_app.py b/module/web/json_app.py
index f3626405c..196c9e36d 100644
--- a/module/web/json_app.py
+++ b/module/web/json_app.py
@@ -232,38 +232,23 @@ def set_captcha():
return {'captcha': False}
-@route("/json/load_config/:category/:section")
+@route("/json/load_config/:section")
@login_required("SETTINGS")
-def load_config(category, section):
- conf = None
- if category == "general":
- conf = PYLOAD.getConfigDict()
- elif category == "plugin":
- conf = PYLOAD.getPluginConfigDict()
+def load_config(section):
+ data = PYLOAD.configureSection(section)
+ return render_to_response("settings_item.html", {"section": data})
- for key, option in conf[section].iteritems():
- if key in ("desc","outline"): continue
- if ";" in option["type"]:
- option["list"] = option["type"].split(";")
-
- option["value"] = decode(option["value"])
-
- return render_to_response("settings_item.html", {"skey": section, "section": conf[section]})
-
-
-@route("/json/save_config/:category", method="POST")
+@route("/json/save_config", method="POST")
@login_required("SETTINGS")
-def save_config(category):
+def save_config():
for key, value in request.POST.iteritems():
try:
section, option = key.split("|")
except:
continue
- if category == "general": category = "core"
-
- PYLOAD.setConfigValue(section, option, decode(value), category)
+ PYLOAD.setConfigValue(section, option, decode(value))
@route("/json/add_account", method="POST")