模块:Cn2e
跳转到导航
跳转到搜索
亦可参看英文模块:Module:Cn2e。那边可能有更完整或更正确的信息。
为Template:cn2e提供支持。
local cache = mw.ext.LuaCache
local VariablesLua = mw.ext.VariablesLua
----------------------------------------------------------------------------------------
local purge = function()
info = mw.loadData('Module:Cn2e/db')
cache.set( ':_cn2e:data', info )
return info
end
return {
loadData = function(frame)
local db = cache.get( ':_cn2e:data')
if not (db and db['__OK__']) then
db = purge()
end
for k,v in pairs(db) do
VariablesLua.vardefine( 'te-'..k, v )
end
end,
purge = function()
purge()
end,
delete = function()
cache.delete(':_cn2e:data')
end,
}