diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-05-24 21:44:02 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-05-24 21:44:02 +0200 |
commit | 29ac21c98b9733ab9cb967cc5ae51aa9b23bed19 (patch) | |
tree | 556a83da92c78074ec867b7d6520ad054e6e5c3c /module/config | |
parent | moved common to utils package (diff) | |
download | pyload-29ac21c98b9733ab9cb967cc5ae51aa9b23bed19.tar.xz |
added production / devel mode to webui
Diffstat (limited to 'module/config')
-rw-r--r-- | module/config/ConfigManager.py | 10 | ||||
-rw-r--r-- | module/config/default.py | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/module/config/ConfigManager.py b/module/config/ConfigManager.py index 85088020b..3290ed4ec 100644 --- a/module/config/ConfigManager.py +++ b/module/config/ConfigManager.py @@ -4,7 +4,7 @@ from new_collections import OrderedDict from module.Api import InvalidConfigSection -from module.utils import from_string, primary_uid, json +from module.utils import from_string, json from ConfigParser import ConfigParser @@ -60,8 +60,7 @@ class ConfigManager(ConfigParser): # Check if this config exists # Configs without meta data can not be loaded! data = self.config[section].config[option] - self.loadValues(user, section) - return self.values[user, section][option] + return self.loadValues(user, section)[option] except KeyError: pass # Returns default value later @@ -100,7 +99,10 @@ class ConfigManager(ConfigParser): return changed def saveValues(self, user, section): - self.db.saveConfig(section, json.dumps(self.values[user, section]), user) + if section in self.parser and user is None: + self.save() + elif (user, section) in self.values: + self.db.saveConfig(section, json.dumps(self.values[user, section]), user) def delete(self, section, user=None): """ Deletes values saved in db and cached values for given user, NOT meta data diff --git a/module/config/default.py b/module/config/default.py index dfa967284..8a2044281 100644 --- a/module/config/default.py +++ b/module/config/default.py @@ -67,6 +67,7 @@ def make_config(config): ("host", "ip", _("IP"), _("Tooltip"), "0.0.0.0"), ("https", "bool", _("Use HTTPS"), _("Tooltip"), False), ("port", "int", _("Port"), _("Tooltip"), 8001), + ("develop", "str", _("Development mode"), _(""), False), ]) config.addConfigSection("proxy", _("Proxy"), _("Description"), _("Long description"), |