Comparison

core/modulemanager.lua @ 6661:90e846e8a788

modulemanager: Add luacheck annotations
author Matthew Wild <mwild1@gmail.com>
date Wed, 06 May 2015 19:16:16 +0100
parent 6660:30672cc3d8ee
child 6779:6236668da30a
comparison
equal deleted inserted replaced
6660:30672cc3d8ee 6661:90e846e8a788
129 local mod = modulemap["*"][module_name]; 129 local mod = modulemap["*"][module_name];
130 if module_has_method(mod, "add_host") then 130 if module_has_method(mod, "add_host") then
131 local _log = logger.init(host..":"..module_name); 131 local _log = logger.init(host..":"..module_name);
132 local host_module_api = setmetatable({ 132 local host_module_api = setmetatable({
133 host = host, event_handlers = new_multitable(), items = {}; 133 host = host, event_handlers = new_multitable(), items = {};
134 _log = _log, log = function (self, ...) return _log(...); end; 134 _log = _log, log = function (self, ...) return _log(...); end; --luacheck: ignore 212/self
135 },{ 135 },{
136 __index = modulemap["*"][module_name].module; 136 __index = modulemap["*"][module_name].module;
137 }); 137 });
138 local host_module = setmetatable({ module = host_module_api }, { __index = mod }); 138 local host_module = setmetatable({ module = host_module_api }, { __index = mod });
139 host_module_api.environment = host_module; 139 host_module_api.environment = host_module;
150 150
151 151
152 152
153 local _log = logger.init(host..":"..module_name); 153 local _log = logger.init(host..":"..module_name);
154 local api_instance = setmetatable({ name = module_name, host = host, 154 local api_instance = setmetatable({ name = module_name, host = host,
155 _log = _log, log = function (self, ...) return _log(...); end, event_handlers = new_multitable(), 155 _log = _log, log = function (self, ...) return _log(...); end, --luacheck: ignore 212/self
156 reloading = not not state, saved_state = state~=true and state or nil } 156 event_handlers = new_multitable(), reloading = not not state,
157 saved_state = state~=true and state or nil }
157 , { __index = api }); 158 , { __index = api });
158 159
159 local pluginenv = setmetatable({ module = api_instance }, { __index = _G }); 160 local pluginenv = setmetatable({ module = api_instance }, { __index = _G });
160 api_instance.environment = pluginenv; 161 api_instance.environment = pluginenv;
161 162