Modul:Debug
This is [[MediaWiki:Tagline]]. Set to <code>display:none</code> by chameleon skin.
This module is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. |
This is a module that can be used for testing purposes.
Usage
{{#invoke:Debug|function_name}}
The above documentation is transcluded from Modul:Debug/doc. (edit | history) Subpages of this module. |
local classDebug = require('Module:Debug/class')
local p = {}
function p.runTest(frame)
local myCargoUtil = require('Module:CargoUtil')
local myTableTools = require('Module:TableTools')
--[==[
local query = { tables = 'configuration_setting', fields = { 'default_value', 'description', 'is_unset', 'name', 'parent', 'type' }, where = 'parent = "Extension:Cargo"', }
local attributes = {}
--local str = myCargoUtil.rawquery('extension', nil, {'name', 'is_default'}, nil, nil, nil, nil, attributes)
local t = myCargoUtil.query(query, attributes)
--return '<pre>' .. mw.text.nowiki(str) .. '</pre><br><pre>' .. myTableTools.printTable(t) .. '</pre>' .. classDebug:printLog(9)
return '<pre>' .. myTableTools.printTable(t) .. '</pre>' .. classDebug:printLog(9)
local Class = require('Module:Instance extension/class')
local test = Class:new('Instanz:Test', 'Extension:Cargo')
local test2 = Class:new('Instanz:Test', 'Extension:SyntaxHighlight GeSHi')
return tostring(test:sfGenerateForm()) .. tostring(test2:sfGenerateForm()) .. classDebug:printLog(9)
]==]
local Class = require('Module:Instance extension/class')
local test = Class:new('Instanz:Test', 'Extension:Cargo')
local e_query = {
tables = 'extension',
fields = { 'description', 'documentation_link', 'include_command', 'is_default', 'restricted_to' },
where = '_pageName = "Extension:Cargo"',
}
local result = myCargoUtil.query(e_query)
local Class = require('Module:Extension/class')
obj = Class:new('Extension:Cargo')
obj:initMyself()
obj:addPageBody()
obj:addInfobox()
return obj:render() .. tostring(test:sfGenerateForm()) .. myTableTools.printTable(result)
end
function p.printLog(frame)
local llevel = frame.args[1] or frame.args.llevel or 1
llevel = tonumber(llevel)
return classDebug:printLog(llevel)
end
return p