Revision: 4098 Author: valhallasw Date: 2007-08-23 15:50:02 +0000 (Thu, 23 Aug 2007)
Log Message: ----------- Bugfix https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1780332... Page.botMayEdit() now calls get(force=True) so any get exceptions are ignored.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-08-23 14:29:17 UTC (rev 4097) +++ trunk/pywikipedia/wikipedia.py 2007-08-23 15:50:02 UTC (rev 4098) @@ -750,8 +750,8 @@ import re; p = re.compile(r"{{(?P<type>bots|nobots)|?(?P<data>.*?)}}") try: - txt = self.get(); - except NoPage: + txt = self.get(force=True); + except (NoPage, IsRedirectPage): return True
m = p.search(txt);
Is this change forcing the bot to load every page twice? If so, maybe there is a less costly way to solve the problem.
On Thu, 23 Aug 2007 15:50:03 +0000, valhallasw@svn.wikimedia.org said:
Revision: 4098 Author: valhallasw Date: 2007-08-23 15:50:02 +0000 (Thu, 23 Aug 2007)
Log Message:
Bugfix https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1780332... Page.botMayEdit() now calls get(force=True) so any get exceptions are ignored.
Modified Paths:
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
--- trunk/pywikipedia/wikipedia.py 2007-08-23 14:29:17 UTC (rev 4097) +++ trunk/pywikipedia/wikipedia.py 2007-08-23 15:50:02 UTC (rev 4098) @@ -750,8 +750,8 @@ import re; p = re.compile(r"{{(?P<type>bots|nobots)|?(?P<data>.*?)}}") try:
txt = self.get();
except NoPage:
txt = self.get(force=True);
except (NoPage, IsRedirectPage): return True m = p.search(txt);
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Is this change forcing the bot to load every page twice? If so, maybe there is a less costly way to solve the problem.
The description of page.get(force=True) was "Set force to True to ignore all exceptions (including redirects)." which is ambiguous, to say the least. I rewrote botMayEdit completely (no more ugly regexps) (r4104) and changed the docstring to read "Set force to True to force a reload of all page attributes, including errors." (r4105).
Thanks for the report (:
--valhallasw
pywikipedia-l@lists.wikimedia.org