From d013498b9886e45fc4b725a6009032ba5fe04369 Mon Sep 17 00:00:00 2001 From: mkaay Date: Mon, 13 Sep 2010 22:49:01 +0200 Subject: better plugin config parsing --- module/PluginManager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/PluginManager.py b/module/PluginManager.py index cc5c7cc53..fe4a94dac 100644 --- a/module/PluginManager.py +++ b/module/PluginManager.py @@ -30,6 +30,7 @@ from os.path import abspath from sys import version_info from itertools import chain +from ast import literal_eval class PluginManager(): @@ -165,7 +166,12 @@ class PluginManager(): config = self.reConfig.findall(content) if config: - config = [ [y.strip() for y in x.replace("'","").replace('"',"").replace("\") ","").split(",")] for x in config[0].split(" (\"") if x.strip()] + config = literal_eval(config[0].strip().replace("\n", "").replace("\r", "")) + if type(config[0]) == tuple: + config = [list(x) for x in config] + else: + config = [list(config)] + if folder == "hooks": config.append( ["load", "bool", "Load on startup", True if name not in ("XMPPInterface", "MultiHome") else False] ) -- cgit v1.2.3