Module:Cycling race/subfunctions
Apparence
La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
--functions accessible from other module
local p = {}
flag_table = {}
wiki = string.match(mw.site.server, "%a+")
if wiki == "www" then
wiki = "fr"
onwikidata = true
else
onwikidata = false
end
function p.fooA (mode,entity,property,var)
local snak
if mode=="value" then snak=entity.claims[property][var].mainsnak.datavalue.value
else snak=entity.claims[property][var].mainsnak.datavalue.value[mode]
end
return snak, entity.claims[property][var].rank
end
function p.fooB (mode, entity_var, property, var1, var2, ref, var3)
local snak
if mode == 'value' then snak = entity_var.claims[property][var1].references[var2].snaks[ref][var3].datavalue.value
else snak = entity_var.claims[property][var1].references[var2].snaks[ref][var3].datavalue.value[mode]
end
return snak
end
function p.fooC (mode, entity_var, property, var1, quali, var2)
local snak
if mode == 'value' then snak = entity_var.claims[property][var1].references[var2].snaks[ref][var3].datavalue.value
else snak = entity_var.claims[property][var1].qualifiers[quali][var2].datavalue.value[mode]
end
return snak
end
function p.foo1 (arg)
local entity = mw.wikibase.getEntity( arg )
end
function p.foo2 (entity_var, property, var)
local snak = entity_var.claims[property][var].mainsnak.datavalue.value.amount
end
function p.foo3 (entity_var, property, var1, quali, var2)
local snak = entity_var.claims[property][var1].qualifiers[quali][var2].datavalue.value.amount
end
function p.black_list(wiki, Label)
-- List of Wikipedia articles with the same lemma as the non existing rider article. Those lemmas are printed as text "black" in the tables,
-- not "blue" or "red". This way there will be no false wikilinks at the WhatLinksHere entry. List should be updated maybe once a year.
local black_list = {}
if wiki=='de' then black_list={ ["Ryan Anderson"]=true, ["Chris Butler"]=true, ["Josef Černý"]=true, ["Brad Evans"]=true, ["Robert Fontaine"]=true,
["Carlos Giménez"]=true, ["George Harper"]=true, ["Mathias Jørgensen"]=true, ["Luis Lemus"]=true, ["David Lozano"]=true, ["Jan Maas"]=true,
["James McLaughlin"]=true, ["Nikolaj Michajlow"]=true, ["Antonio Molina"]=true, ["Ben O'Connor"]=true, ["Andrea Peron"]=true, ["Cristian Rodríguez"]=true,
["Nick Schultz"]=true, ["Adam Stachowiak"]=true, ["Michel Vermote"]=true, ["Johannes Weber"]=true, ["Martin Weiss"]=true, ["Christopher Williams"]=true,
["Samuel Williams"]=true, ["Peter Williams"]=true, ['Stephen Williams']=true, ["Michael Woods"]=true, ["Michael Wright"] = true, ["Edoardo Zardini"]=true,
["Georg Zimmermann"]=true } end
if wiki=='en' then black_list={ ["Tiago da Silva"]=true, ["Jan Maas"]=true, ["Alexander Meier"]=true, ["James McLaughlin"]=true, ["Andrea Nencini"]=true,
["Johannes Weber"]=true } end
if wiki=='fr' then black_list={['Pierre Barbier']=true, ['Jessica Cutler']=true, ['Fernanda da Silva']=true, ['Guillaume Delvaux']=true, ['Willy De Waele']=true,
['Jules Dubois']=true, ['Jean Dupont']=true, ['Robert Fontaine']=true, ['René Fournier']=true, ['Pierre Gauthier']=true, ['Marc Goossens']=true,
['Claude Guyot']=true, ['Amy Hill']=true, ['Liang Hongyu']=true, ['Marcus Johansson']=true, ['Mathias Jørgensen']=true, ['José Mendoza']=true,
['Daniel Müller']=true, ['Henri Parmentier']=true, ['Jean Raynal']=true, ['Pascal Robert']=true, ['Jean-Yves Roy']=true, ['Michael Shermer']=true,
['Juris Silovs']=true, ['Jacques Simon']=true, ['Guy Thomas']=true, ['Ryan Thomas']=true, ['Hans Vonk']=true, ['Jan Wijnants']=true } end
return black_list[Label]
end
return p