[Pywikipedia-l] SVN: [6280] branches/rewrite/pywikibot

russblau at svn.wikimedia.org russblau at svn.wikimedia.org
Fri Jan 23 13:39:36 UTC 2009


Revision: 6280
Author:   russblau
Date:     2009-01-23 13:39:36 +0000 (Fri, 23 Jan 2009)

Log Message:
-----------
user-configurable maxlag

Modified Paths:
--------------
    branches/rewrite/pywikibot/bot.py
    branches/rewrite/pywikibot/data/api.py

Modified: branches/rewrite/pywikibot/bot.py
===================================================================
--- branches/rewrite/pywikibot/bot.py	2009-01-23 01:17:43 UTC (rev 6279)
+++ branches/rewrite/pywikibot/bot.py	2009-01-23 13:39:36 UTC (rev 6280)
@@ -245,22 +245,24 @@
             showHelp()
             sys.exit(0)
         elif arg.startswith('-family:'):
-            config.family = arg[8:]
+            config.family = arg[len("-family:" : ]
         elif arg.startswith('-lang:'):
-            config.mylang = arg[6:]
+            config.mylang = arg[len("-lang:" : ]
         elif arg.startswith("-user:"):
-            username = arg[6:]
+            username = arg[len("-user:") : ]
         elif arg.startswith('-putthrottle:'):
-            config.put_throttle = int(arg[13:])
+            config.put_throttle = int(arg[len("-putthrottle:") : ])
         elif arg.startswith('-pt:'):
-            config.put_throttle = int(arg[4:])
+            config.put_throttle = int(arg[len("-pt:") : ])
+        elif arg.startswith("-maxlag:"):
+            config.maxlag = int(arg[len("-maxlag:") : ])
         elif arg == '-log':
             if moduleName not in config.log:
                 config.log.append(moduleName)
         elif arg.startswith('-log:'):
             if moduleName not in config.log:
                 config.log.append(moduleName)
-            config.logfilename = arg[5:]
+            config.logfilename = arg[len("-log:" : ]
         elif arg == '-nolog':
             if moduleName in config.log:
                 config.log.remove(moduleName)

Modified: branches/rewrite/pywikibot/data/api.py
===================================================================
--- branches/rewrite/pywikibot/data/api.py	2009-01-23 01:17:43 UTC (rev 6279)
+++ branches/rewrite/pywikibot/data/api.py	2009-01-23 13:39:36 UTC (rev 6280)
@@ -20,7 +20,7 @@
 import warnings
 
 import pywikibot
-from pywikibot import login
+from pywikibot import config, login
 from pywikibot.exceptions import *
 
 logger = logging.getLogger("data.api")
@@ -159,7 +159,7 @@
                     info = set(info + ["protection", "talkid", "subjectid"])
                     self.params["info"] = list(info)
         if "maxlag" not in self.params:
-            self.params["maxlag"] = [str(pywikibot.config2.maxlag)]
+            self.params["maxlag"] = [str(config.maxlag)]
         if "format" not in self.params:
             self.params["format"] = ["json"]
         if self.params['format'] != ["json"]:





More information about the Pywikipedia-l mailing list