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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: AltLinkTemplateSubster: * More skip pages, e.g. Template:Cfb link/testcases. d::Sections: * Correctly handle the undefined match fields when processing section 0.
AnomieBOT (talk | contribs)
Updating published sources: TFATitleSubpageCreator: * Move to AnomieBOT II * Approved SourceUploader: * Add a new bit of metadata, with a new column in the output. All: * Add the new metadata field.
Line 7:
=begin metadata
 
Bot: AnomieBOT
Task: SourceUploader
BRFA: N/A
Line 161 ⟶ 162:
$x ="<noinclude>\n";
$x.="{| class=\"wikitable\"\n";
$x.="! Bot !! Task !! Disable !! {{tlx|bots}} !! Status !! Description\n";
$x.="</noinclude>\n";
$x.="|- valign=\"top\"\n";
my $task=$metadata{'task'};
my $botmainbot="\x02BOT\x03";
my $x.bot="|align=\"center\"| [[User:$metadata{'bot'} /source$pp|/ $task]]\n"mainbot;
$x.="|align=\"center\"| [[User:$bot|$bot]]\n";
$x.="|align=\"center\"| [[User:$mainbot/source$pp|$task]]\n";
if(exists($metadata{'shutoff'}) && $metadata{'shutoff'} eq 'false'){
$x.="|align=\"center\"| No\n";
} else {
$x.="|align=\"center\"| <span class=\"plainlinks\">[{{fullurl:User:$bot/shutoff/$task|action=edit}} Here]</span>\n";
push @{$self->{'shutoff_pages'}}, "User:$bot/shutoff/$task";
}
if(exists($metadata{'exclusion'}) && $metadata{'exclusion'} eq 'false'){
Line 201 ⟶ 204:
my $section=determine_task_section(".$pp", %metadata);
$tasks{$section}=[] unless exists($tasks{$section});
push @{$tasks{$section}}, $metadata{'created'}." {{User:$botmainbot/source$pp/metadata}}";
}
}
Line 238 ⟶ 241:
if(@links){
$tasklist.="{| class=\"wikitable sortable\"\n";
$tasklist.="! Bot !! Task !! Disable !! {{tlx|bots}} !! ".(($n==1 || $n==2)?'Approval':'Status')." !! Description\n";
$tasklist.=join("\n", map { substr($_,11) } @links)."\n";
$tasklist.="|}\n";
Line 313 ⟶ 316:
 
while(@shutoff){
my $taskpage=shift @shutoff;
my $page='User:'.$api->user."/shutoff/$task";
my $tok=$api->edittoken($page);
if($tok->{'code'} eq 'shutoff'){
Line 372 ⟶ 374:
 
my $t=$file; $t=~s{^.*/}{}; $t=~s/\.pm$//;
return '99 Invalid metadata' unless exists($metadata{'bot'});
return '99 Invalid metadata' unless(exists($metadata{'task'}) && $metadata{'task'} eq $t);
return '99 Invalid metadata' unless exists($metadata{'brfa'});