jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/503755 )
Change subject: [cleanup] cleanup scriptpath for FandomFamily
......................................................................
[cleanup] cleanup scriptpath for FandomFamily
- Rename WikiaFamily to FandomFamily and deprecate the old identifier
- FandomFamily does not have different domains for different site codes
but distingued scriptpath except for "en".
- update scriptpath for wowwiki_family.py and lyricwiki_family.py
Bug: T220913
Change-Id: Idaca2928ed228cac32b975fbb8b4f044b66c5fe4
---
M pywikibot/families/lyricwiki_family.py
M pywikibot/families/wowwiki_family.py
M pywikibot/family.py
3 files changed, 14 insertions(+), 11 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/families/lyricwiki_family.py
b/pywikibot/families/lyricwiki_family.py
index 1819b3a..c35d262 100644
--- a/pywikibot/families/lyricwiki_family.py
+++ b/pywikibot/families/lyricwiki_family.py
@@ -15,7 +15,7 @@
# user-config.py:
# usernames['lyricwiki']['en'] = 'user'
-class Family(family.SubdomainFamily, family.WikiaFamily):
+class Family(family.SubdomainFamily, family.FandomFamily):
"""Family class for LyricWiki."""
@@ -23,10 +23,6 @@
domain = 'lyrics.fandom.com'
codes = ('en', 'ru')
- def scriptpath(self, code):
- """Return the script path for this family."""
- return '' if code == 'en' else ('/' + code)
-
@deprecated('APISite.version()', since='20141225')
def version(self, code):
return '1.19.24'
diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py
index 5a468dd..55f55ea 100644
--- a/pywikibot/families/wowwiki_family.py
+++ b/pywikibot/families/wowwiki_family.py
@@ -11,7 +11,7 @@
from pywikibot.tools import deprecated, classproperty
-class Family(family.SubdomainFamily, family.WikiaFamily):
+class Family(family.SubdomainFamily, family.FandomFamily):
"""Family class for WOW Wiki."""
@@ -73,4 +73,6 @@
def scriptpath(self, code):
"""Return the script path for this family."""
- return '' if code in ('en', 'uk') else ('/' +
code)
+ if code == 'uk':
+ return ''
+ return super(Family, self).scriptpath(code)
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 5f5c932..73545be 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -23,7 +23,7 @@
from pywikibot.exceptions import UnknownFamily, FamilyMaintenanceWarning
from pywikibot.tools import (
deprecated, deprecated_args, remove_last_args, issue_deprecation_warning,
- FrozenDict, classproperty, PY2
+ ModuleDeprecationWrapper, FrozenDict, classproperty, PY2
)
if not PY2:
@@ -1571,13 +1571,13 @@
return [cls.domain]
-class WikiaFamily(Family):
+class FandomFamily(Family):
- """Common features of Wikia families."""
+ """Common features of Fandom families."""
def scriptpath(self, code):
"""Return the script path for this family."""
- return ''
+ return '' if code == 'en' else ('/' + code)
class WikimediaFamily(Family):
@@ -1762,3 +1762,8 @@
# str() used because py2 can't accept a unicode as the name of a class
AutoFamily = type(str('AutoFamily'), (SingleSiteFamily,), locals())
return AutoFamily()
+
+
+wrapper = ModuleDeprecationWrapper(__name__)
+wrapper._add_deprecated_attr('WikiaFamily', replacement=FandomFamily,
+ since='20190420')
--
To view, visit
https://gerrit.wikimedia.org/r/503755
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Idaca2928ed228cac32b975fbb8b4f044b66c5fe4
Gerrit-Change-Number: 503755
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)