http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10261
Revision: 10261
Author: xqt
Date: 2012-05-31 15:45:34 +0000 (Thu, 31 May 2012)
Log Message:
-----------
update -user -maxlag options from rewrite r6171, r6280, r10260
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2012-05-31 15:40:41 UTC (rev 10260)
+++ trunk/pywikipedia/wikipedia.py 2012-05-31 15:45:34 UTC (rev 10261)
@@ -7761,6 +7761,7 @@
# the module name will be used for the filename of the log.
moduleName = calledModuleName()
nonGlobalArgs = []
+ username = None
do_help = False
for arg in args:
arg = _decodeArg(arg)
@@ -7772,12 +7773,16 @@
default_family = arg[8:]
elif arg.startswith('-lang:'):
default_code = arg[6:]
+ elif arg.startswith("-user:"):
+ username = arg[len("-user:") : ]
elif arg.startswith('-putthrottle:'):
config.put_throttle = int(arg[len("-putthrottle:") : ])
put_throttle.setDelay()
elif arg.startswith('-pt:'):
config.put_throttle = int(arg[len("-pt:") : ])
put_throttle.setDelay()
+ elif arg.startswith("-maxlag:"):
+ config.maxlag = int(arg[len("-maxlag:") : ])
elif arg == '-log':
setLogfileStatus(True)
elif arg.startswith('-log:'):
@@ -7809,6 +7814,9 @@
# about it.
nonGlobalArgs.append(arg)
+ if username:
+ config.usernames[config.family][config.mylang] = username
+
# TEST for bug #3081100
if unicode_error:
output("""
@@ -7851,6 +7859,8 @@
wikipedia, wiktionary, wikitravel, ...
This will override the configuration in user-config.py.
+-user:xyz Log in as user 'xyz' instead of the default username.
+
-daemonize:xyz Immediately return control to the terminal and redirect
stdout and stderr to xyz (only use for bots that require
no input from stdin).
@@ -7862,6 +7872,10 @@
-log:xyz Enable the logfile, using 'xyz' as the filename.
+-maxlag Sets a new maxlag parameter to a number of seconds. Defer bot
+ edits during periods of database server lag. Default is set by
+ config.py
+
-nolog Disable the logfile (if it is enabled by default).
-putthrottle:n Set the minimum time (in seconds) the bot will wait between
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10260
Revision: 10260
Author: xqt
Date: 2012-05-31 15:40:41 +0000 (Thu, 31 May 2012)
Log Message:
-----------
doc for -maxlag option, introduced with r6280
Modified Paths:
--------------
branches/rewrite/pywikibot/bot.py
Modified: branches/rewrite/pywikibot/bot.py
===================================================================
--- branches/rewrite/pywikibot/bot.py 2012-05-27 18:15:12 UTC (rev 10259)
+++ branches/rewrite/pywikibot/bot.py 2012-05-31 15:40:41 UTC (rev 10260)
@@ -534,6 +534,10 @@
-log:xyz Enable the logfile, using 'xyz' as the filename.
+-maxlag Sets a new maxlag parameter to a number of seconds. Defer bot
+ edits during periods of database server lag. Default is set by
+ config.py
+
-nolog Disable the logfile (if it is enabled by default).
-debug:item Enable the logfile and include extensive debugging data
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10258
Revision: 10258
Author: xqt
Date: 2012-05-27 10:12:41 +0000 (Sun, 27 May 2012)
Log Message:
-----------
Process changed on de-wiki. Do not use it until this has been fixed here.
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2012-05-26 21:21:16 UTC (rev 10257)
+++ trunk/pywikipedia/checkimages.py 2012-05-27 10:12:41 UTC (rev 10258)
@@ -81,7 +81,7 @@
# (C) Kyle/Orgullomoore, 2006-2007 (newimage.py)
# (C) Siebrand Mazeland, 2007-2010
# (C) Filnik, 2007-2011
-# (C) Pywikipedia team, 2007-2011
+# (C) Pywikipedia team, 2007-2012
#
# Distributed under the terms of the MIT license.
#
@@ -122,13 +122,13 @@
# Text that the bot will try to see if there's already or not. If there's a
# {{ I'll use a regex to make a better check.
# This will work so:
-# '{{nld' --> '\{\{(?:template:|)no[ _]license ?(?:\||\n|\}) ?' (case
+# '{{no license' --> '\{\{(?:template:|)no[ _]license ?(?:\||\n|\}) ?' (case
# insensitive).
# If there's not a {{ it will work as usual (if x in Text)
txt_find = {
'commons':[u'{{no license', u'{{no license/en', u'{{nld', u'{{no permission', u'{{no permission since'],
'ar':[u'{{لت', u'{{لا ترخيص'],
- 'de':[u'{{DÜP', u'{{Dateiüberprüfung'],
+ 'de':[u'{{DÜP', u'{{Düp', u'{{Dateiüberprüfung'],
'en':[u'{{nld', u'{{no license'],
'fa':[u'{{حق تکثیر تصویر نامعلوم۲'],
'ga':[u'{{Ceadúnas de dhíth', u'{{Ceadúnas de dhíth'],
@@ -294,7 +294,7 @@
# NOTE: YOUR Botnick is automatically added. It's not required to add it twice.
bot_list = {
'commons':[u'Siebot', u'CommonsDelinker', u'Filbot', u'John Bot', u'Sz-iwbot', u'ABFbot'],
- 'de' :[u'ABFbot'],
+ #'de' :[u'ABFbot'],
'en' :[u'OrphanBot'],
'fa' :[u'Amirobot'],
'ga' :[u'AllieBot'],
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10256
Revision: 10256
Author: xqt
Date: 2012-05-26 19:57:34 +0000 (Sat, 26 May 2012)
Log Message:
-----------
initialize self.ns for older mw releases
Modified Paths:
--------------
trunk/pywikipedia/xmlreader.py
Modified: trunk/pywikipedia/xmlreader.py
===================================================================
--- trunk/pywikipedia/xmlreader.py 2012-05-26 13:23:03 UTC (rev 10255)
+++ trunk/pywikipedia/xmlreader.py 2012-05-26 19:57:34 UTC (rev 10256)
@@ -102,6 +102,7 @@
# They are initialized here so they at least have some value when
# asked for
self.id = u''
+ self.ns = u''
self.revisionid = u''
self.comment = u''
self.isredirect = False
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10255
Revision: 10255
Author: xqt
Date: 2012-05-26 13:23:03 +0000 (Sat, 26 May 2012)
Log Message:
-----------
watchlist is also retrieved via api; doc changed
Modified Paths:
--------------
trunk/pywikipedia/watchlist.py
Modified: trunk/pywikipedia/watchlist.py
===================================================================
--- trunk/pywikipedia/watchlist.py 2012-05-26 12:48:59 UTC (rev 10254)
+++ trunk/pywikipedia/watchlist.py 2012-05-26 13:23:03 UTC (rev 10255)
@@ -2,10 +2,10 @@
"""
Allows access to the bot account's watchlist.
-The function refresh() downloads the current watchlist and saves
-it to disk. It is run automatically when a bot first tries to save a page
-retrieved via XML Export. The watchlist can be updated manually by running
-this script. The list will also be reloaded automatically once a month.
+The function refresh() downloads the current watchlist and saves it to disk. It
+is run automatically when a bot first tries to save a page retrieved. The
+watchlist can be updated manually by running this script. The list will also
+be reloaded automatically once a month.
Syntax: python watchlist [-all]
@@ -15,8 +15,9 @@
-new - Load watchlists for all wikis where accounts is setting in
user-config.py
"""
-
+#
# (C) Daniel Herding, 2005
+# (C) Pywikipedia bot team, 2005-2012
#
# Distributed under the terms of the MIT license.
#