Revision: 4462 Author: a_engels Date: 2007-10-17 14:55:24 +0000 (Wed, 17 Oct 2007)
Log Message: ----------- Re-instating the -array command line option (number of pages to work on at once) and creating the -query command line option (number of pages to load at once)
Modified Paths: -------------- trunk/pywikipedia/interwiki.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2007-10-17 13:35:27 UTC (rev 4461) +++ trunk/pywikipedia/interwiki.py 2007-10-17 14:55:24 UTC (rev 4462) @@ -171,6 +171,16 @@ will be changed if there are that number or more links to change or add
+The following arguments influence how many pages the bot works on at once: + -array: The number of pages the bot tries to be working on at once. + If the number of pages loaded is lower than this number, + a new set of pages is loaded from the starting wiki. The + default is 100, but can be changed in the config variable + interwiki_min_subjects + + -query: The maximum number of pages that the bot will load at once. + Default value is 60. + Some configuration option can be used to change the working of this robot:
interwiki_min_subjects: the minimum amount of subjects that should be processed @@ -354,6 +364,7 @@ bracketonly = False rememberno = False followinterwiki = True + minsubjects = config.interwiki_min_subjects
class Subject(object): """ @@ -1253,7 +1264,7 @@ # Do we still have enough subjects to work on for which the # home language has been retrieved? This is rough, because # some subjects may need to retrieve a second home-language page! - if len(self.subjects) - mycount < config.interwiki_min_subjects: + if len(self.subjects) - mycount < globalvar.minsubjects: # Can we make more home-language queries by adding subjects? if self.pageGenerator and mycount < globalvar.maxquerysize: timeout = 60 @@ -1510,6 +1521,10 @@ globalvar.bracketonly = True elif arg == '-localright': globalvar.followinterwiki = False + elif arg.startswith('-array:'): + globalvar.minsubjects = int(arg[7:]) + elif arg.startswith('-query:'): + globalvar.maxquerysize = int(arg[7:]) else: generator = genFactory.handleArg(arg) if generator: