User:AnomieBOT/source/tasks/SourceUploader.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: General: * Have bot.pl set $0, for more useful ps output. * New utility function to return the bot base directory. SourceUploader: * Use said new utility function.
AnomieBOT (talk | contribs)
Updating published sources: General: * BREAKING CHANGE: $api->edittoken() now takes named parameters for parameters other than $page. * $api->edittoken() has two new options, to disable the shutoff or {{tl|bots}} checking. SourceUploader: * Add two m
Line 160:
$x ="<noinclude>\n";
$x.="{| class=\"wikitable\"\n";
$x.="! Task !! Disable !! Status{{tlx|bots}} !! RateStatus !! Description\n";
$x.="</noinclude>\n";
$x.="|- valign=\"top\"\n";
Line 166:
my $bot="\x02BOT\x03";
$x.="|align=\"center\"| [[User:$bot/source$pp|$task]]\n";
if(exists($x.="|align=\"center\"|metadata{'shutoff'}) <span&& class=\"plainlinks\">[{{fullurl:User:$bot/metadata{'shutoff/$task|action=edit}'} Here]</span>\n";eq 'false'){
$x.="| align=\".$metadata{'rate'}.center\"| No\n";
} else {
$x.="|align=\"center\"| <span class=\"plainlinks\">[{{fullurl:User:$bot/shutoff/$task|action=edit}} Here]</span>\n";
}
if(exists($metadata{'exclusion'}) && $metadata{'exclusion'} eq 'false'){
$x.="|align=\"center\"| {{N}}\n";
} else {
$x.="|align=\"center\"| {{Y}}\n";
}
my $brfa=$metadata{'brfa'};
my $status=$metadata{'status'};
Line 183 ⟶ 192:
$x.="</p>\n";
}
$x.="| ".$metadata{'rate'}."\n";
$x.="|\n".$metadata{'*'}."\n";
$x.="<noinclude>\n";
Line 229 ⟶ 237:
if(@links){
$tasklist.="{| class=\"wikitable sortable\"\n";
$tasklist.="! Task !! Disable !! {{tlx|bots}} !! ".(($n==1 || $n==2)?'Approval':'Status')." !! Edit Rate !! Description\n";
$tasklist.=join("\n", map { substr($_,11) } @links)."\n";
$tasklist.="|}\n";
Line 354 ⟶ 362:
if(exists($metadata{'ondemand'})){
return '99 Invalid metadata' unless($metadata{'ondemand'} eq 'true' || $metadata{'ondemand'} eq 'false');
}
if(exists($metadata{'shutoff'})){
return '99 Invalid metadata' unless($metadata{'shutoff'} eq 'true' || $metadata{'shutoff'} eq 'false');
}
if(exists($metadata{'exclusion'})){
return '99 Invalid metadata' unless($metadata{'exclusion'} eq 'true' || $metadata{'exclusion'} eq 'false');
}
my $status=$metadata{'status'};