Comparison

core/modulemanager.lua @ 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
parent 1523:841d61be198f
child 1694:0b7888c0995d
comparison
equal deleted inserted replaced
1585:edc066730d11 1586:5c627d5d5e37
416 if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message 416 if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message
417 setfenv(f, setmetatable({ module = self }, { __index = _G })); 417 setfenv(f, setmetatable({ module = self }, { __index = _G }));
418 return f(); 418 return f();
419 end 419 end
420 420
421 function api:get_option(name, default_value)
422 return config.get(self.host, self.name, name) or config.get(self.host, "core", name) or default_value;
423 end
424
421 -------------------------------------------------------------------- 425 --------------------------------------------------------------------
422 426
423 local actions = {}; 427 local actions = {};
424 428
425 function actions.load(params) 429 function actions.load(params)