http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9971
Revision: 9971
Author: binbot
Date: 2012-03-08 16:18:42 +0000 (Thu, 08 Mar 2012)
Log Message:
-----------
Starting the survey for old Python versions. See
http://thread.gmane.org/gmane.comp.python.pywikipediabot.general/12473
Modified Paths:
--------------
trunk/pywikipedia/config.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2012-03-05 17:48:45 UTC (rev 9970)
+++ trunk/pywikipedia/config.py 2012-03-08 16:18:42 UTC (rev 9971)
@@ -584,6 +584,10 @@
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-05 17:48:45 UTC (rev 9970)
+++ trunk/pywikipedia/wikipedia.py 2012-03-08 16:18:42 UTC (rev 9971)
@@ -8234,6 +8234,28 @@
MyURLopener.addheaders = [('User-agent', useragent)]
+# 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:
+ output(
+"""
+\03{lightyellow}Dear Pwikipedia user!\03{default}
+Pywikibot has detected that you use an outdated version of Python.
+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.
+""")
+
if __name__ == '__main__':
import doctest
print 'Pywikipediabot %s' % version.getversion()