[Pywikipedia-l] [ pywikipediabot-Patches-1867322 ] Mark pages for deletion, which cannot deleted rightaway.
SourceForge.net
noreply at sourceforge.net
Mon Jan 14 00:53:27 UTC 2008
Patches item #1867322, was opened at 2008-01-09 00:54
Message generated for change (Comment added) made by purodha
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1867322&group_id=93107
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: Purodha B Blissenbach (purodha)
Assigned to: Nobody/Anonymous (nobody)
Summary: Mark pages for deletion, which cannot deleted rightaway.
Initial Comment:
Category.py can delete category pages when the user chooses so, and when having access to an account with admin privileges.
If it does not have an admin account, it currently does nothing, and the information that the page should be deleted is lost.
A better solution was to mark those pages for later deletion by a human admin, by adding {{delete}} or a localized version thereof.
The attached patch is adding "{{delete}} reason ~~~~" plus a horizontal line, and line ends, to categories that category.py cannot delete because it is having no admin privileges. The SWMT suggest to have {{delete}} at least as a redirect in every WMF wiki, but the name would better be localized, too.
Not that, since the main part of the modification is three lines added to wikipedia.py, other bot programs could use it, too. In order to do so, they need to add a parameter when calling wikipedia.delete() like this:
wikipedia.delete(markfordeletion=u'reason')
where u'reason' must not be empty. It is the wikitext to be put into the page behind "{{delete}}".
----------------------------------------------------------------------
>Comment By: Purodha B Blissenbach (purodha)
Date: 2008-01-14 00:53
Message:
Logged In: YES
user_id=46450
Originator: YES
Regarding the current version:
1. the name of the parameter should be consistent, else it would not
work.
2. I strongly suggest that the bot should "sign" his note in the page for
the time being, since some wikis require it so. The string should be
localized in the course of time, though.
--- wikipedia.py (revision 4878)
+++ wikipedia.py (working copy)
@@ -1967,10 +1967,10 @@
except NoUsername, error:
# user hasn't entered an admin username.
output(str(error))
- if markfordeletion and self.exists():
+ if mark and self.exists():
text = self.get(get_redirect = True)
output(u'Marking the page for deletion instead:')
- self.put(u'{{delete}}\n%s\n----\n\n%s' % (reason,
text), comment = reason)
+ self.put(u'{{delete}}\n%s ~~~~\n----\n\n%s' %
(reason, text), comment = reason)
return
reason = reason.encode(self.site().encoding())
token = self.site().getToken(self, sysop = True)
----------------------------------------------------------------------
Comment By: Rotem Liss (rotemliss)
Date: 2008-01-13 16:58
Message:
Logged In: YES
user_id=1327030
Originator: NO
Applied the (slightly changed) patch in r4867.
----------------------------------------------------------------------
Comment By: Purodha B Blissenbach (purodha)
Date: 2008-01-09 17:42
Message:
Logged In: YES
user_id=46450
Originator: YES
I did nor want to change the default behaviour. --Purodha
----------------------------------------------------------------------
Comment By: Daniel Herding (wikipedian)
Date: 2008-01-09 17:08
Message:
Logged In: YES
user_id=880694
Originator: NO
This is a good idea. However, why do we need a special parameter
"markfordeletion"? The "reason" parameter should be OK for this. This is
simpler and works without modifying existing bots. --Daniel
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1867322&group_id=93107
More information about the Pywikipedia-l
mailing list