From d2ac990fae74934887cba6a01ed5bb6d6c576422 Mon Sep 17 00:00:00 2001 From: Joel Andres Granados Date: Fri, 8 Aug 2008 17:23:51 +0200 Subject: Make the argument passing more general. It is possible for the plugin name to have a space. when this occured it threw off the argument detecting logic. This new way of detecting the plugin name is more general. --- pyfirstaidkit/plugins.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pyfirstaidkit/plugins.py') diff --git a/pyfirstaidkit/plugins.py b/pyfirstaidkit/plugins.py index e373322..3dda77c 100644 --- a/pyfirstaidkit/plugins.py +++ b/pyfirstaidkit/plugins.py @@ -27,6 +27,7 @@ import logging import imp import os +import re import subprocess from cStringIO import StringIO @@ -602,8 +603,13 @@ class PluginSystem(object): return False args = None - if Config.has_option("plugin-args", pklass.name): - args = Config.get("plugin-args", pklass.name) + if Config.has_section("plugin-args"): + for (name, value) in Config.items("plugin-args"): + # We see if the args line begins with any plugin name. + m = re.search("^%s"%plugin, value) + if m: + args = value.strip(plugin).strip(" ") + break infosection = getattr(Info, plugin) infosection.unlock() -- cgit