http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9973
Revision: 9973 Author: binbot Date: 2012-03-09 11:08:24 +0000 (Fri, 09 Mar 2012) Log Message: ----------- Follow-up to r9971, see comments on mediawiki.org
Modified Paths: -------------- trunk/pywikipedia/config.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/config.py =================================================================== --- trunk/pywikipedia/config.py 2012-03-09 09:42:53 UTC (rev 9972) +++ trunk/pywikipedia/config.py 2012-03-09 11:08:24 UTC (rev 9973) @@ -3,7 +3,7 @@ # (C) Rob W.W. Hooft, 2003 # parts by holger@trillke.net 2002/03/18 # Purodha Blissenbach (Modifier), 2010 -# (C) Pywikipedia bot team, 2007-2010 +# (C) Pywikipedia bot team, 2007-2012 # # Distributed under the terms of the MIT license. # @@ -477,6 +477,12 @@ # processing. As higher this value this effect will decrease. max_queue_size = 64
+############## TEMPORARY SETTINGS ############## +# Temporary solution for 2012 version survey, search for this key +# in wikipedia.py +import sys # Just for the next line, remove them together +suppresssurvey = (sys.version >= '2.7.2') + # End of configuration section # ============================
@@ -584,10 +590,6 @@ print " Was: ",ot print " Now: ",nt del nt, ot - elif _key == 'suppresssurvey': - # Temporary solution for 2012 version survey, search for this key - # in wikipedia.py - pass else: print "WARNING: Configuration variable %r is defined but unknown. Misspelled?" %_key
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2012-03-09 09:42:53 UTC (rev 9972) +++ trunk/pywikipedia/wikipedia.py 2012-03-09 11:08:24 UTC (rev 9973) @@ -8237,24 +8237,19 @@ # This is a temporary part for the 2012 version survey # http://thread.gmane.org/gmane.comp.python.pywikipediabot.general/12473 # Upon removing the connected lines from config.py should be removed, too. -if sys.version < '2.7.2': - try: - if config.suppresssurvey == True: - pass - else: - raise AttributeError - except AttributeError: +if not config.suppresssurvey: output( """ \03{lightyellow}Dear Pwikipedia user!\03{default} -Pywikibot has detected that you use an outdated version of Python. +Pywikibot has detected that you use this outdated version of Python: +%s. We would like to hear your voice before ceasing support of this version. Please update to \03{lightyellow}Python 2.7.2\03{default} if possible or visit http://www.mediawiki.org/wiki/Pywikipediabot/Survey2012 to tell us why we should support your version and to learn how to hide this message. After collecting opinions for a time we will decide and announce the deadline of deprecating use of old Python versions for Pywikipedia. -""") +""" % sys.version)
if __name__ == '__main__': import doctest