Comparison

core/modulemanager.lua @ 3624:e2cfc6b8fe5d

Merge backout
author Matthew Wild <mwild1@gmail.com>
date Sat, 13 Nov 2010 04:12:49 +0000
parent 3623:6f4db418a9cc
child 3677:dad563ed54aa
comparison
equal deleted inserted replaced
3622:418354197a02 3624:e2cfc6b8fe5d
115 local _log = logger.init(host..":"..module_name); 115 local _log = logger.init(host..":"..module_name);
116 local api_instance = setmetatable({ name = module_name, host = host, config = config, _log = _log, log = function (self, ...) return _log(...); end }, { __index = api }); 116 local api_instance = setmetatable({ name = module_name, host = host, config = config, _log = _log, log = function (self, ...) return _log(...); end }, { __index = api });
117 117
118 local pluginenv = setmetatable({ module = api_instance }, { __index = _G }); 118 local pluginenv = setmetatable({ module = api_instance }, { __index = _G });
119 api_instance.environment = pluginenv; 119 api_instance.environment = pluginenv;
120 pluginenv._M = pluginenv;
121 120
122 setfenv(mod, pluginenv); 121 setfenv(mod, pluginenv);
123 hosts[host].modules = modulemap[host]; 122 hosts[host].modules = modulemap[host];
124 modulemap[host][module_name] = pluginenv; 123 modulemap[host][module_name] = pluginenv;
125 124