Changeset

444:77485b9b840c

Add module:unload() to mod_console, and allow module:load() to take config param
author Matthew Wild <mwild1@gmail.com>
date Thu, 27 Nov 2008 23:36:17 +0000
parents 443:bd1397b1dfc9
children 450:e04c4052742c
files plugins/mod_console.lua
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;