Jump to content

Module:Sandbox/Ahecht/sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
rm unused variable
update
Line 6: Line 6:


function p.main(frame)
function p.main(frame)
local siteStats = ''
local mwSite, mwSiteStats = '', ''
for k,v in pairs(mw.site.stats) do if type(v) ~= 'function' then siteStats = siteStats .. '\n**' .. k .. ': ' .. v end end
for k,v in pairs(mw.site) do if type(v) == 'string' then mwSite = mwSite .. '\n*' .. k .. ': ' .. v end end
for k,v in pairs(mw.site.stats) do if type(v) ~= 'function' then mwSiteStats = mwSiteStats .. '\n**' .. k .. ': ' .. v end end
local output = '*Version: ' .. mw.site.currentVersion .. '\n*$wgScriptPath: ' .. mw.site.scriptPath .. '\n*$wgServer: ' .. mw.site.server .. '\n*$wgSitename: ' .. mw.site.siteName .. '\n*$wgStylePath: ' .. mw.site.stylePath .. '\n*mw.site.stats: ' .. siteStats
return 'mw.site: ' .. mwSite .. '\n*mw.site.stats: ' .. mwSiteStats
return output
end
end



Revision as of 16:58, 21 March 2018

local p = {}

local function _main(args)
	return true
end

function p.main(frame)
	local mwSite, mwSiteStats = '', ''
	for k,v in pairs(mw.site) do if type(v) == 'string' then mwSite = mwSite .. '\n*' .. k .. ': ' .. v end end
	for k,v in pairs(mw.site.stats) do if type(v) ~= 'function' then mwSiteStats = mwSiteStats .. '\n**' .. k .. ': ' .. v end end
	return 'mw.site: ' .. mwSite .. '\n*mw.site.stats: ' .. mwSiteStats
end

return p