jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/593004 )
Change subject: [families] Add wikihow_family.py to pywikibot/families ......................................................................
[families] Add wikihow_family.py to pywikibot/families
Bug: T249814 Change-Id: I60eb029c9d68f28fd5a65384782fa9b2814a8593 --- A pywikibot/families/wikihow_family.py 1 file changed, 60 insertions(+), 0 deletions(-)
Approvals: Matěj Suchánek: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/families/wikihow_family.py b/pywikibot/families/wikihow_family.py new file mode 100644 index 0000000..478fca3 --- /dev/null +++ b/pywikibot/families/wikihow_family.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +"""Family module for Wikihow Wiki.""" +# +# (C) Pywikibot team, 2020 +# +# Distributed under the terms of the MIT license. +# +from pywikibot import family +from pywikibot.tools import deprecated, classproperty + + +class Family(family.SubdomainFamily): # noqa: D101 + + name = 'wikihow' + domain = 'wikihow.com' + + codes = ( + 'ar', 'cs', 'de', 'en', 'es', 'fr', 'hi', 'id', 'it', 'ja', 'ko', 'nl', + 'pt', 'ru', 'th', 'tr', 'vi', 'zh', + ) + removed_wikis = ['ca', 'cy', 'fa', 'he', 'pl', 'ur'] + + @classproperty + def domains(cls): + """List of domains used by family wikihow.""" + return [ + cls.domain, + 'wikihow.cz', # cs + 'wikihow.it', + 'wikihow.jp', # ja + 'wikihow.com.tr', + 'wikihow.vn', # vi + ] + + @classproperty + def langs(cls): + """Property listing family languages.""" + code_replacement = {'cz': 'cs', 'jp': 'ja', 'vn': 'vi'} + cls.langs = super().langs + cls.langs['en'] = 'www.' + cls.domain + for domain in cls.domains: + if domain == cls.domain: + continue + *_, code = domain.rpartition('.') + code = code_replacement.get(code, code) + cls.langs[code] = 'www.' + domain + return cls.langs + + def scriptpath(self, code): + """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'
pywikibot-commits@lists.wikimedia.org