http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9974
Revision: 9974
Author: xqt
Date: 2012-03-09 11:43:44 +0000 (Fri, 09 Mar 2012)
Log Message:
-----------
Revert r9966 of rewrite branch: sr and zh are now 1.19
Modified Paths:
--------------
branches/rewrite/pywikibot/families/wikipedia_family.py
Modified: branches/rewrite/pywikibot/families/wikipedia_family.py
===================================================================
--- branches/rewrite/pywikibot/families/wikipedia_family.py 2012-03-09 11:08:24 UTC (rev 9973)
+++ branches/rewrite/pywikibot/families/wikipedia_family.py 2012-03-09 11:43:44 UTC (rev 9974)
@@ -573,12 +573,6 @@
# xxwikipedia for Wikipedias.
return '%swiki_p' % code
- def version(self, code):
- """Return MediaWiki version number as a string."""
- # Don't use this, use versionnumber() instead. This only exists
- # to not break family files.
- return code in ['sr', 'zh'] and '1.18wmf1' or '1.19wmf1'
-
def code2encodings(self, code):
"""Return a list of historical encodings for a specific language
wikipedia"""
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(a)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