Wikipedia:Bots/Requests for approval/EarwigBot 20
- The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was Approved.
Operator: The Earwig (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 04:43, Tuesday, December 1, 2015 (UTC)
Automatic, Supervised, or Manual: Supervised
Programming language(s): Python with earwigbot
Source code available: infobox_station.py
Function overview: Replace {{Infobox China station}} and {{Infobox Japan station}} with {{Infobox station}}
Links to relevant discussions (where appropriate): China TfD, Japan TfD, previous BRFA
Edit period(s): One-time run
Estimated number of pages affected: ~7000 ([1][2])
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): Yes
Function details: Fairly straightforward, I hope. Most of the logic is handled by the sandboxes, and has been discussed in the previous BRFA; the bot just replaces the template invocation with its sandbox ({{Infobox China station/sandbox}} and {{Infobox Japan station/sandbox}}) and substitutes it. There is some additional logic to inserting categories which were previously automatically added by the template using two helpers (1 and 2).
Discussion
[edit]- Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. — we've been over this fairly extensively, to the point where it's time to just do a few and ensure everything turns out okay. :P --slakr\ talk / 03:56, 2 December 2015 (UTC)[reply]
- Trial complete. Edits. Bit of an annoying cat issue going on; adds a category twice in at least one case.
Don't think I can fix this using the current implementation.I can, of course, but it will take a little bit of work. That other category shouldn't be there in the first place. I also fixed the extra newline issue seen in a few edits. — Earwig talk 11:39, 5 December 2015 (UTC)[reply]- At a glance, it seems you possibly need to just check if the category was already on the page before actually adding it in _add_cats (unless I'm missing something here). Hazard SJ 20:57, 5 December 2015 (UTC)[reply]
- _add_cats has no knowledge of the categories it's actually adding (that's handled by Template:Infobox China station/sandbox/cats), hence the trouble. — Earwig talk 20:58, 5 December 2015 (UTC)[reply]
- Fixed. A bit dirty (using action=parse), but it should work. — Earwig talk 11:42, 6 December 2015 (UTC)[reply]
- _add_cats has no knowledge of the categories it's actually adding (that's handled by Template:Infobox China station/sandbox/cats), hence the trouble. — Earwig talk 20:58, 5 December 2015 (UTC)[reply]
- At a glance, it seems you possibly need to just check if the category was already on the page before actually adding it in _add_cats (unless I'm missing something here). Hazard SJ 20:57, 5 December 2015 (UTC)[reply]
- Trial complete. Edits. Bit of an annoying cat issue going on; adds a category twice in at least one case.
Approved. If there are any further issues they can be easily dealt. Magioladitis (talk) 12:43, 8 December 2015 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.