Patches item #3477090, was opened at 2012-01-21 12:06 Message generated for change (Comment added) made by valhallasw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603140&aid=3477090...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Michael Thibault (phoenixca) Assigned to: Nobody/Anonymous (nobody) Summary: Minor improvements on add_text.py
Initial Comment: Added an open in browser option to confirmation dialogue (similar to replace.py ) and added a new -only arg (essentially the opposite of -except). If a page text doesn't match the -only regex given, it skips.
Example use: I added this while trying to clean-up a Wikia wiki. Wikia's RTE leaves [[File:Placeholder on pages often. With this addition, the bot can use -only:"[[File:Placeholder" -except:"{{image}}" -text:"{{image}}" -up , to add a meta tag to pages that have image placeholders, but not ones that already have the {{image}} tag.
----------------------------------------------------------------------
Comment By: Merlijn S. van Deen (valhallasw)
Date: 2012-01-21 13:34
Message: Looks very nice. There are a few (minor) issues that should be fixed though: * the regexOnly should be added at *last* parameter in add_text, so as not to break API compatibility * Match was %s""" % result) doesn't make sense if there is no match (result will always be [])
and I cnanot see this (I'm only looking at the diff, lazy me) - what is the goal of the 'continue' on line 61 of the diff? If I look at the return just above, there is no for loop going on, which makes the continue do nothing... but I may be wrong.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603140&aid=3477090...
pywikipedia-bugs@lists.wikimedia.org