Changeset

1378:d09ecc8ee1ef

modulemanager: Call 'load' method when loading a module
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Jun 2009 02:58:05 +0100
parents 1377:ae88b9dc7890
children 1379:03d8a930053f
files core/modulemanager.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;