User:Rybecbot
disclose changes to script
← Older revision
Revision as of 21:10, 22 March 2013
Line 2:
Line 2:
[[File:TOSY_DiscoRobo_04.JPG|thumb|left|This is a bot account. Its operator can be reached at [[User_talk:Rybec]].]]
[[File:TOSY_DiscoRobo_04.JPG|thumb|left|This is a bot account. Its operator can be reached at [[User_talk:Rybec]].]]
−
This bot is being used to automatically re-upload files which have been cropped to remove watermarks. It makes no more than two edits per minute. It is run intermittently. It is the pywikipediabot upload.py script.
+
This bot is being used to automatically re-upload files which have been cropped to remove watermarks. It makes no more than two edits per minute. It is run intermittently. It is the pywikipediabot upload.py script with the following changes to allow unattended re-uploading:
+
+
+
+
--- upload.py.orig 2011-11-29 20:00:13.000000000 +0000
+
+++ upload.py.modified 2013-03-22 20:54:41.409844613 +0000
+
@@ -83,7 +83,7 @@
+
class UploadRobot:
+
def __init__(self, url, urlEncoding=None, description=u'',
+
useFilename=None, keepFilename=False, verifyDescription=True,
+
- ignoreWarning=False, targetSite=None, uploadByUrl=False):
+
+ ignoreWarning=True, targetSite=None, uploadByUrl=False):
+
"""
+
@param ignoreWarning: Set this to True if you want to upload even if
+
another file would be overwritten or another mistake would be
+
@@ -232,13 +232,6 @@
+
pywikibot.output(self.description)
+
if self.verifyDescription:
+
newDescription = u''
+
- choice = pywikibot.inputChoice(
+
- u'Do you want to change this description?',
+
- ['Yes', 'No'], ['y', 'N'], 'n')
+
- if choice == 'y':
+
- import editarticle
+
- editor = editarticle.TextEditor()
+
- newDescription = editor.edit(self.description)
+
# if user saved / didn't press Cancel
+
if newDescription:
+
self.description = newDescription
+
http://commons.wikimedia.org/w/index.php?title=User:Rybecbot&diff=93107107&oldid=93068302