Thu, 27 Nov 2008 23:36:17 +0000
Add module:unload() to mod_console, and allow module:load() to take config param
plugins/mod_console.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/mod_console.lua Thu Nov 27 17:12:05 2008 +0000 +++ b/plugins/mod_console.lua Thu Nov 27 23:36:17 2008 +0000 @@ -129,15 +129,24 @@ end def_env.module = {}; -function def_env.module:load(name, host) +function def_env.module:load(name, host, config) local mm = require "modulemanager"; - local ok, err = mm.load(host or self.env.host, name); + local ok, err = mm.load(host or self.env.host, name, config); if not ok then return false, err or "Unknown error loading module"; end return true, "Module loaded"; end +function def_env.module:unload(name, host) + local mm = require "modulemanager"; + local ok, err = mm.unload(host or self.env.host, name); + if not ok then + return false, err or "Unknown error unloading module"; + end + return true, "Module unloaded"; +end + def_env.config = {}; function def_env.config:load(filename, format) local config_load = require "core.configmanager".load;