modulemanager: Call 'load' method when loading a module

Mon, 22 Jun 2009 02:58:05 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 22 Jun 2009 02:58:05 +0100
changeset 1378
d09ecc8ee1ef
parent 1377
ae88b9dc7890
child 1379
03d8a930053f

modulemanager: Call 'load' method when loading a module

core/modulemanager.lua file | annotate | diff | comparison | revisions
--- a/core/modulemanager.lua	Sat Jun 20 22:50:38 2009 +0100
+++ b/core/modulemanager.lua	Mon Jun 22 02:58:05 2009 +0100
@@ -134,6 +134,13 @@
 		return nil, ret;
 	end
 	
+	if module_has_method(pluginenv, "load") then
+		local ok, err = call_module_method(pluginenv, "load");
+		if (not ok) and err then
+			log("warn", "Error loading module '%s' on '%s': %s", module_name, host, err);
+		end
+	end
+
 	-- Use modified host, if the module set one
 	modulemap[api_instance.host][module_name] = pluginenv;
 	

mercurial