Last modified: 2013-10-05 11:44:24 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/65/ Reported by: tuvic Created on: 2006-07-19 13:01:54 Subject: Ask before creating graphs in interwiki.py Original description: In the interwiki.py, there's a very handy feature to create graphs of ambigious interwikis. The only annoyance, is that it takes ages if the amount of pages is big. Also, it doesn't look to be able to create correct png's of those huge interwiki-layouts. \(but that might be an error in pydot maybe\) To get rid of this annoyance, I'd like the interwiki-bot to ask wether of not to create a graph. I experimented already a little, and came up with this rudimentary code: In stead of if config.interwiki\_graph: self.createGraph\(\) I'dd add something like this: if config.interwiki\_graph: print "Found %s error\(s\) in %s wiki\(s\) \(total: %s pages\)"% \(nerr,len\(new.items\(\)\), len\(self.foundin.iterkeys\(\)\)\) while 1: dodraw = wikipedia.input\(u"Do you want to draw a graph? \[\(y\)es, \(n\)o\] : "\) if dodraw: if dodraw in 'nN': \# Don't draw a graph break elif dodraw in 'yY': self.createGraph\(\) break Maybe there could be some command-line option that can be set to always draw a graph if the number of pages is below a certain amount, or something like that. Thanks, Tuvic P.S. While I came up with this idea, created code, and tested it a bit, the interwikibot is now already 2 hours trying to make a graph of the interwikis of Albania...