jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/630605 )
Change subject: [cleanup] remove deprecated Family.version methods ......................................................................
[cleanup] remove deprecated Family.version methods
Change-Id: Iaabdfac04933eadc444db1ab63bb147d3d5427e2 --- M generate_family_file.py M pywikibot/families/wikihow_family.py M pywikibot/families/wikispore_family.py M pywikibot/families/wowwiki_family.py M pywikibot/family.py 5 files changed, 1 insertion(+), 52 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/generate_family_file.py b/generate_family_file.py index 25d6e22..3c4e1e4 100755 --- a/generate_family_file.py +++ b/generate_family_file.py @@ -130,11 +130,6 @@ "'{code}': '{path}',".format(code=k, path=w.scriptpath) for k, w in self.wikis.items())
- code_version_pairs = '\n '.join( - "'{code}': None,".format(code=k) if w.version is None else - "'{code}': '{version}',".format(code=k, version=w.version) - for k, w in self.wikis.items()) - code_protocol_pairs = '\n '.join( "'{code}': '{protocol}',".format( code=k, protocol=urlparse(w.server).scheme @@ -145,7 +140,6 @@ 'url': self.base_url, 'name': self.name, 'code_hostname_pairs': code_hostname_pairs, 'code_path_pairs': code_path_pairs, - 'code_version_pairs': code_version_pairs, 'code_protocol_pairs': code_protocol_pairs})
@@ -161,7 +155,6 @@ Please do not commit this to the Git repository! """ from pywikibot import family -from pywikibot.tools import deprecated
class Family(family.Family): # noqa: D101 @@ -176,12 +169,6 @@ %(code_path_pairs)s }[code]
- @deprecated('APISite.version()', since='20141225') - def version(self, code): - return { - %(code_version_pairs)s - }[code] - def protocol(self, code): return { %(code_protocol_pairs)s diff --git a/pywikibot/families/wikihow_family.py b/pywikibot/families/wikihow_family.py index 478fca3..174d5b1 100644 --- a/pywikibot/families/wikihow_family.py +++ b/pywikibot/families/wikihow_family.py @@ -6,7 +6,7 @@ # Distributed under the terms of the MIT license. # from pywikibot import family -from pywikibot.tools import deprecated, classproperty +from pywikibot.tools import classproperty
class Family(family.SubdomainFamily): # noqa: D101 @@ -50,11 +50,6 @@ """Return the script path for this family.""" return ''
- @deprecated('APISite.version()', since='20141225') - def version(self, code): - """Return the version for this family.""" - return '1.33.0-alpha' - def protocol(self, code): """Return 'https' as the protocol.""" return 'https' diff --git a/pywikibot/families/wikispore_family.py b/pywikibot/families/wikispore_family.py index f395cb7..1213d2c 100644 --- a/pywikibot/families/wikispore_family.py +++ b/pywikibot/families/wikispore_family.py @@ -6,7 +6,6 @@ # Distributed under the terms of the MIT license. # from pywikibot import family -from pywikibot.tools import deprecated
class Family(family.Family): # noqa: D101 @@ -19,9 +18,5 @@ 'test': 'wikispore-test.wmflabs.org', }
- @deprecated('APISite.version()', since='20141225') - def version(self, code): - return '1.36.0-alpha' - def protocol(self, code): return 'https' diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py index fa6dac1..49f9f7d 100644 --- a/pywikibot/families/wowwiki_family.py +++ b/pywikibot/families/wowwiki_family.py @@ -32,13 +32,6 @@ """DEPRECATED. languages_by_size property for compatibility purpose.""" return list(cls.codes)
- @deprecated('APISite.version()', since='20141225') - def version(self, code): - """Return the version for this family.""" - if code == 'es': - return '1.33.1' - return super().version(code) - @classproperty def langs(cls): """Property listing family languages.""" diff --git a/pywikibot/family.py b/pywikibot/family.py index 8df90ce..ea62c52 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -19,7 +19,6 @@ from typing import Dict, List, Optional, Tuple
import pywikibot -from pywikibot.comms.http import fetch from pywikibot import config from pywikibot.exceptions import UnknownFamily, FamilyMaintenanceWarning from pywikibot.tools import ( @@ -1030,21 +1029,6 @@ """Return the name of the MySQL database.""" return '%s%s' % (code, self.name)
- # Which version of MediaWiki is used? - @deprecated('APISite.version()', since='20141225') - def version(self, code): - """Return MediaWiki version number as a string. - - Use L{pywikibot.site.mw_version} to compare version strings. - """ - # Here we return the latest mw release for downloading - if not hasattr(self, '_version'): - self._version = fetch( - 'https://www.mediawiki.org/w/api.php?action=expandtemplates' - '&text={{MW_stable_release_number}}&prop=wikitext&format=json' - ).data.json()['expandtemplates']['wikitext'] - return self._version - def force_version(self, code): """ Return a manual version number. @@ -1263,11 +1247,6 @@
"""Common features of Fandom families."""
- @deprecated('APISite.version()', since='20141225') - def version(self, code): - """Return the version for this family.""" - return '1.19.24' - @classproperty def langs(cls): """Property listing family languages."""