# HG changeset patch # User Matthew Wild # Date 1227828977 0 # Node ID 77485b9b840c8719d0f3357fa989fd704c03e7fe # Parent bd1397b1dfc9d1b9ad291655cd575067836306b9 Add module:unload() to mod_console, and allow module:load() to take config param diff -r bd1397b1dfc9 -r 77485b9b840c plugins/mod_console.lua --- 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;