jenkins-bot merged this change.
[cleanup] Put fandom defaults into FandomFamily
Put version and protocol methods and lang property into FandomFamily
Change-Id: If9a66cfba2e186f20c044ea2fe0896c9b623e5c9
---
M pywikibot/families/lyricwiki_family.py
M pywikibot/families/wowwiki_family.py
M pywikibot/family.py
M tox.ini
4 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/pywikibot/families/lyricwiki_family.py b/pywikibot/families/lyricwiki_family.py
index c35d262..c8ed640 100644
--- a/pywikibot/families/lyricwiki_family.py
+++ b/pywikibot/families/lyricwiki_family.py
@@ -8,7 +8,6 @@
from __future__ import absolute_import, division, unicode_literals
from pywikibot import family
-from pywikibot.tools import classproperty, deprecated
# The LyricWiki family
@@ -22,16 +21,3 @@
name = 'lyricwiki'
domain = 'lyrics.fandom.com'
codes = ('en', 'ru')
-
- @deprecated('APISite.version()', since='20141225')
- def version(self, code):
- return '1.19.24'
-
- def protocol(self, code):
- """Return 'https' as the protocol."""
- return 'https'
-
- @classproperty
- def langs(cls):
- """Property listing family languages."""
- return {code: cls.domain for code in cls.codes}
diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py
index c3b6b21..10326f7 100644
--- a/pywikibot/families/wowwiki_family.py
+++ b/pywikibot/families/wowwiki_family.py
@@ -35,13 +35,13 @@
@classproperty
def langs(cls):
"""Property listing family languages."""
- cls.langs = {code: cls.domain for code in cls.codes}
+ cls.langs = super(Family, cls).langs
cls.langs.update({code: cls.domains[1] for code in ('es', 'et')})
cls.langs['uk'] = 'uk.' + cls.domains[2]
return cls.langs
@classproperty
- def disambiguationTemplates(cls):
+ def disambiguationTemplates(cls): # noqa: N802
"""Property listing disambiguation templates."""
cls.disambiguationTemplates = \
super(Family, cls).disambiguationTemplates
@@ -68,14 +68,11 @@
"""List of domains used by family wowwiki."""
return [cls.domain, 'worldofwarcraft.fandom.com', 'warcraft.wikia.com']
- @deprecated('APISite.version()', since='20141225')
- def version(self, code):
- """Return the version for this family."""
- return '1.19.24'
-
def protocol(self, code):
"""Return the protocol for this family."""
- return 'http' if code == 'uk' else 'https'
+ if code == 'uk':
+ return 'http'
+ return super(Family, self).protocol(code)
def scriptpath(self, code):
"""Return the script path for this family."""
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 7d7dd69..4545ffa 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1602,6 +1602,20 @@
"""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."""
+ return {code: cls.domain for code in cls.codes}
+
+ def protocol(self, code):
+ """Return 'https' as the protocol."""
+ return 'https'
+
def scriptpath(self, code):
"""Return the script path for this family."""
return '' if code == 'en' else ('/' + code)
diff --git a/tox.ini b/tox.ini
index 8114a09..f4910a0 100644
--- a/tox.ini
+++ b/tox.ini
@@ -135,7 +135,6 @@
pywikibot/exceptions.py : H501, N802
# classproperties; most docs should go to family.py
pywikibot/families/* : D102
- pywikibot/families/wowwiki_family.py: N802
pywikibot/family.py : E241, N802, N803, N806, N815
pywikibot/fixes.py : E241
pywikibot/flow.py: N802
To view, visit change 505626. To unsubscribe, or for help writing mail filters, visit settings.