diff options
author | 2014-11-09 16:52:01 +0100 | |
---|---|---|
committer | 2014-11-09 16:52:01 +0100 | |
commit | 12bf6e492c980814646c6bc6e88a2ed759f5acbc (patch) | |
tree | 9f9af19b6dd43e881e74d21dd9b921b13cf923f8 /module/plugins/PluginManager.py | |
parent | [ZippyshareCom] Update NAME_PATTERN (diff) | |
download | pyload-12bf6e492c980814646c6bc6e88a2ed759f5acbc.tar.xz |
[PluginManager] Improve error handling for parse method
Diffstat (limited to 'module/plugins/PluginManager.py')
-rw-r--r-- | module/plugins/PluginManager.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index 43e9f9ad4..82702eb7f 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -149,19 +149,19 @@ class PluginManager: config = self.CONFIG.findall(content) if config: - config = literal_eval(config[0].strip().replace("\n", "").replace("\r", "")) - desc = self.DESC.findall(content) - desc = desc[0][1] if desc else "" + try: + config = literal_eval(config[0].strip().replace("\n", "").replace("\r", "")) + desc = self.DESC.findall(content) + desc = desc[0][1] if desc else "" - if type(config[0]) == tuple: - config = [list(x) for x in config] - else: - config = [list(config)] + if type(config[0]) == tuple: + config = [list(x) for x in config] + else: + config = [list(config)] - if folder not in ("accounts", "internal") and not [True for item in config if item[0] == "activated"]: - config.insert(0, ["activated", "bool", "Activated", False if folder == "hooks" else True]) + if folder not in ("accounts", "internal") and not [True for item in config if item[0] == "activated"]: + config.insert(0, ["activated", "bool", "Activated", False if folder == "hooks" else True]) - try: self.core.config.addPluginConfig(name, config, desc) except: self.log.error("Invalid config in %s: %s" % (name, config)) |