Modulo:Software: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m -debug
+licenses() → _licenses(); +_licenses()
Riga 1:
local mWikidata = require('Modulo:Wikidata')
local getArgs = require('ModuleModulo:Arguments').getArgs
local conf = mw.loadData('Modulo:Software/Configurazione')
 
Riga 193:
* @return pairs( {} )
]]
local licenses__licenses_cache = false
-- Cache
function p._licenses(frame)
local licenses_ = false
if licenses__licenses_cache == false then
licenses__licenses_cache = mWikidata._getClaims('P275') or {}
end
return _licenses_cache
end
 
function p.licenses(frame)
local s = ''
if licenses_ == false then
for i, l in pairs( p._licenses(frame) ) do
licenses_ = mWikidata._getClaims('P275') or {}
local space = i == 1 and '' or '<br />'
s = s .. space .. mWikidata._formatStatement(l)
end
return licenses_s
end
 
Riga 226 ⟶ 234:
]]
function p._hasAFreeLicense(frame)
for _, license in pairs( p.licenses_licenses(frame) ) do
license = mWikidata._formatStatement(license, {formatting = 'raw'})
if p._licenseIsFree(license) then
Riga 239 ⟶ 247:
]]
function p._hasAProprietaryLicense(frame)
for _, license in pairs( p.licenses_licenses(frame) ) do
license = mWikidata._formatStatement(license, {formatting = 'raw'})
if p._licenseIsProprietary(license) then