Revision: 5927
Author: cydeweys
Date: 2008-10-02 02:37:56 +0000 (Thu, 02 Oct 2008)
Log Message:
-----------
Fixing the Remove robot so that it also deletes a talk page, if one exists.
The default behavior of the Removal robot has been altered so that it uses
a custom edit summary (if one is given) in preference to the default edit
summary when performing a deletion of the category page. This behavior is
most likely preferred because a custom edit summary is almost guaranteed to
contain information that is more helpful than "Category was disbanded".
Modified Paths:
--------------
trunk/pywikipedia/category.py
Modified: trunk/pywikipedia/category.py
===================================================================
--- trunk/pywikipedia/category.py 2008-10-01 21:00:43 UTC (rev 5926)
+++ trunk/pywikipedia/category.py 2008-10-02 02:37:56 UTC (rev 5927)
@@ -31,9 +31,10 @@
* -summary: - Pick a custom edit summary for the bot.
* -inplace - Use this flag to change categories in place rather than
rearranging them.
- * -delsum - An option for remove, this specifies to use the custom edit
- summary as the deletion reason (rather than a canned
- deletion reason)
+ * -nodelsum - An option for remove, this specifies not to use the custom
+ edit summary as the deletion reason. Instead, it uses the
+ default deletion reason for the language, which is "Category
+ was disbanded" in English.
* -overwrite - An option for listify, this overwrites the current page with
the list even if something is already there.
* -showimages - An option for listify, this displays images rather than
@@ -575,7 +576,7 @@
'zh':u'機器人:移除目錄%s',
}
- def __init__(self, catTitle, batchMode = False, editSummary = '', useSummaryForDeletion = False, titleRegex = None, inPlace = False):
+ def __init__(self, catTitle, batchMode = False, editSummary = '', useSummaryForDeletion = True, titleRegex = None, inPlace = False):
self.editSummary = editSummary
self.cat = catlib.Category(wikipedia.getSite(), 'Category:' + catTitle)
# get edit summary message
@@ -603,12 +604,16 @@
else:
for subcategory in subcategories:
catlib.change_category(subcategory, self.cat, None, inPlace = self.inPlace)
+ # Deletes the category page
if self.cat.exists() and self.cat.isEmpty():
- if self.useSummaryForDeletion:
+ if self.useSummaryForDeletion and self.editSummary:
reason = self.editSummary
else:
reason = wikipedia.translate(wikipedia.getSite(), self.deletion_reason_remove)
+ talkPage = self.cat.toggleTalkPage()
self.cat.delete(reason, not self.batchMode)
+ if (talkPage.exists()):
+ talkPage.delete(reason=reason, prompt=not self.batchMode)
class CategoryTidyRobot:
"""
@@ -889,7 +894,7 @@
#If this is set to true then the custom edit summary given for removing
#categories from articles will also be used as the deletion reason.
- useSummaryForDeletion = False
+ useSummaryForDeletion = True
try:
catDB = CategoryDatabase()
action = None
@@ -923,7 +928,10 @@
elif arg == '-inplace':
inPlace = True
elif arg == '-delsum':
- useSummaryForDeletion = True
+ # This parameter is kept for historical reasons, as it was not previously the default option.
+ pass
+ elif arg == '-nodelsum':
+ useSummaryForDeletion = False
elif arg == '-overwrite':
overwrite = True
elif arg == '-showimages':
Bugs item #2119685, was opened at 2008-09-19 18:53
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2119685&group_…
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: interwiki
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: interwiki.py does reverts
Initial Comment:
I got this message. As far as I know is this an old feature, that should be solved a long time ago.
At this moment I'm working with revision 5909. But I don't know with which version I did the reverts.
For the description of the feature see the message send by someones else that detected this feature.
Hello Carsrac,
I would like to draw your attention to these edits made by your bot: [http://de.wikipedia.org/w/index.php?title=Auge&diff=48157069&oldid=48020013 article de:Auge] and [http://la.wikipedia.org/w/index.php?title=The_Beatles&diff=562763&oldid=562… article la:The Beatles]. Obviously, the bot didn't edit the version that was at that time the current one, but an older one. That's equivalent to doing a revert. It seems that the bot edited the second last version that had been created by a bot. In these cases that meant a revert of [http://de.wikipedia.org/w/index.php?title=Auge&diff=48157069&oldid=47723213 two versions] of de:Auge and of [http://la.wikipedia.org/w/index.php?title=The_Beatles&diff=562763&oldid=551… 24 versions] of la:The Beatles.
How could that happen? Is there any reason to believe this didn't happen more often? I believe these are questions to be well considered since the bot seems to have done several thousand, if not tens of thousands of edits during that time. And it would be very assuring to know that the possibility that this still can or will happen can be ruled out.
--[[de:user:Lax]] - [[Gebruiker:88.65.169.226|88.65.169.226]] 19 sep 2008 10:15 (CEST)
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2008-10-01 20:41
Message:
This more likely seems to be the same as [ 1790473 ] Interwiki bot
overwrites changes, no edit conflict.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2008-10-01 20:22
Message:
I don't know whether this and "[ 1999895 ] iw bot doesn't detect edit
conflict" are the same bug, but here it does not really seem to be an edit
conflict. We are talking about 11 and 19 days, repeat DAYS, old versions
here.
----------------------------------------------------------------------
Comment By: Carsrac (carsrac)
Date: 2008-09-20 01:16
Message:
It is the same problem as [ 1999895 ] iw bot doesn't detect edit conflict
----------------------------------------------------------------------
Comment By: NicDumZ Nicolas Dumazet (nicdumz)
Date: 2008-09-20 01:07
Message:
rciw.py for example *will* trigger this behavior quite often, sometimes
working on a version more than 10 hours old. I am not however, able to
confirm this on the standard interwiki.py
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2119685&group_…
Bugs item #2119685, was opened at 2008-09-19 18:53
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2119685&group_…
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: interwiki
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: interwiki.py does reverts
Initial Comment:
I got this message. As far as I know is this an old feature, that should be solved a long time ago.
At this moment I'm working with revision 5909. But I don't know with which version I did the reverts.
For the description of the feature see the message send by someones else that detected this feature.
Hello Carsrac,
I would like to draw your attention to these edits made by your bot: [http://de.wikipedia.org/w/index.php?title=Auge&diff=48157069&oldid=48020013 article de:Auge] and [http://la.wikipedia.org/w/index.php?title=The_Beatles&diff=562763&oldid=562… article la:The Beatles]. Obviously, the bot didn't edit the version that was at that time the current one, but an older one. That's equivalent to doing a revert. It seems that the bot edited the second last version that had been created by a bot. In these cases that meant a revert of [http://de.wikipedia.org/w/index.php?title=Auge&diff=48157069&oldid=47723213 two versions] of de:Auge and of [http://la.wikipedia.org/w/index.php?title=The_Beatles&diff=562763&oldid=551… 24 versions] of la:The Beatles.
How could that happen? Is there any reason to believe this didn't happen more often? I believe these are questions to be well considered since the bot seems to have done several thousand, if not tens of thousands of edits during that time. And it would be very assuring to know that the possibility that this still can or will happen can be ruled out.
--[[de:user:Lax]] - [[Gebruiker:88.65.169.226|88.65.169.226]] 19 sep 2008 10:15 (CEST)
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2008-10-01 20:22
Message:
I don't know whether this and "[ 1999895 ] iw bot doesn't detect edit
conflict" are the same bug, but here it does not really seem to be an edit
conflict. We are talking about 11 and 19 days, repeat DAYS, old versions
here.
----------------------------------------------------------------------
Comment By: Carsrac (carsrac)
Date: 2008-09-20 01:16
Message:
It is the same problem as [ 1999895 ] iw bot doesn't detect edit conflict
----------------------------------------------------------------------
Comment By: NicDumZ Nicolas Dumazet (nicdumz)
Date: 2008-09-20 01:07
Message:
rciw.py for example *will* trigger this behavior quite often, sometimes
working on a version more than 10 hours old. I am not however, able to
confirm this on the standard interwiki.py
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2119685&group_…
Revision: 5925
Author: filnik
Date: 2008-10-01 13:36:59 +0000 (Wed, 01 Oct 2008)
Log Message:
-----------
Applying patch by FiloSottile
Modified Paths:
--------------
trunk/pywikipedia/welcome.py
Modified: trunk/pywikipedia/welcome.py
===================================================================
--- trunk/pywikipedia/welcome.py 2008-09-29 21:00:54 UTC (rev 5924)
+++ trunk/pywikipedia/welcome.py 2008-10-01 13:36:59 UTC (rev 5925)
@@ -85,6 +85,8 @@
-savedata This feature saves the random signature index to allow to
continue to welcome with the last signature used.
+ -sul Welcome the auto-created users (default: False)
+
********************************* GUIDE ***********************************
Report, Bad and white list guide:
@@ -408,7 +410,7 @@
wikipedia.output(u'\nReal-time list loaded.')
return list_loaded
-def parselog(wsite, raw, talk, number):
+def parselog(wsite, raw, talk, number, sul):
""" The function to load the users (only users who have a certain number of edits) """
someone_found = False
autocreated = wsite.mediawiki_message('newuserlog-autocreate-entry')
@@ -427,7 +429,7 @@
someone_found = True
username = x.group('user')
#skip autocreated users (SUL)
- if autocreated in x.group('reason'):
+ if autocreated in x.group('reason') and not sul:
wikipedia.output(u'%s has been created automatically, skipping...' % username)
continue
userpage = wikipedia.Page(wsite, username)
@@ -585,6 +587,7 @@
time_variable = 3600 # how much time (sec.) the bot sleeps before restart
log_variable = True # create the welcome log or not
ask = False # should bot ask to add username to bad-username list
+ sul = False # should bot welcome auto-created users
filter_wp = False # check if the username is ok or not
sign = ' --~~~~' # default signature
random = False # should signature be random or not
@@ -636,6 +639,8 @@
savedata = True
elif arg == '-random':
random = True
+ elif arg == '-sul':
+ sul = True
elif arg.startswith('-limit'):
if len(arg) == 6:
limit = int(wikipedia.input(u'How many of the latest new users would you like to load?'))
@@ -653,7 +658,7 @@
wikipedia.output('WARING: both -offset and -timeoffset were provided, ignoring -offset')
offset_variable = 0
return (None, ask, filename, fileOption, fileSignName, filter_wp, limit, log_variable, number, numberlog, offset_variable, random, recursive,
- savedata, sign, time_variable, timeoffset_variable)
+ savedata, sign, time_variable, timeoffset_variable, sul)
def main(settingsBot):
# Taking the messages inside the function namespace.
@@ -683,6 +688,7 @@
sign = settingsBot[14]
time_variable = settingsBot[15]
timeoffset_variable = settingsBot[16]
+ sul = settingsBot[17]
# The site
wsite = wikipedia.getSite()
@@ -814,7 +820,7 @@
except wikipedia.NoPage:
wikipedia.output(u'The list with signatures is not available... Using default signature...')
random = False
- for found_result in parselog(wsite, log, talk, number):
+ for found_result in parselog(wsite, log, talk, number, sul):
# Compiling the signature to be used.
if random:
if number_user + 1 > len(signList):