Add module:unload() to mod_console, and allow module:load() to take config param

Thu, 27 Nov 2008 23:36:17 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 27 Nov 2008 23:36:17 +0000
changeset 444
77485b9b840c
parent 443
bd1397b1dfc9
child 450
e04c4052742c

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;

mercurial