Changeset

1586:5c627d5d5e37

modulemanager: Added get_option(name, default_value) to plugin API
author Waqas Hussain <waqas20@gmail.com>
date Sat, 25 Jul 2009 18:37:05 +0500
parents 1585:edc066730d11
children 1587:81992255a374
files core/modulemanager.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/modulemanager.lua	Fri Jul 24 01:34:25 2009 +0100
+++ b/core/modulemanager.lua	Sat Jul 25 18:37:05 2009 +0500
@@ -418,6 +418,10 @@
 	return f();
 end
 
+function api:get_option(name, default_value)
+	return config.get(self.host, self.name, name) or config.get(self.host, "core", name) or default_value;
+end
+
 --------------------------------------------------------------------
 
 local actions = {};