jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/572935 )
Change subject: [cleanup] Deprecate family code2encoding/code2encodings aliases
......................................................................
[cleanup] Deprecate family code2encoding/code2encodings aliases
Change-Id: I9879066b3b27621b0b0b1051daa51ab2166b6a27
---
M pywikibot/families/wikipedia_family.py
M pywikibot/families/wikiquote_family.py
M pywikibot/family.py
3 files changed, 16 insertions(+), 14 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/families/wikipedia_family.py
b/pywikibot/families/wikipedia_family.py
index c1dd0213..0693b71 100644
--- a/pywikibot/families/wikipedia_family.py
+++ b/pywikibot/families/wikipedia_family.py
@@ -234,7 +234,7 @@
else:
return self.known_families
- def code2encodings(self, code):
+ def encodings(self, code):
"""Return a list of historical encodings for a specific
site."""
# Historic compatibility
if code == 'pl':
@@ -243,4 +243,4 @@
return 'utf-8', 'iso8859-5'
if code in self.latin1old:
return 'utf-8', 'iso-8859-1'
- return self.code2encoding(code)
+ return super(Family, self).encodings(code)
diff --git a/pywikibot/families/wikiquote_family.py
b/pywikibot/families/wikiquote_family.py
index 395aac3..d6115e7 100644
--- a/pywikibot/families/wikiquote_family.py
+++ b/pywikibot/families/wikiquote_family.py
@@ -69,7 +69,7 @@
'sr': ('/док', ),
}
- def code2encodings(self, code):
+ def encodings(self, code):
"""
Return a list of historical encodings for a specific language.
@@ -80,4 +80,4 @@
return 'utf-8', 'iso8859-2'
if code == 'ru':
return 'utf-8', 'iso8859-5'
- return (self.code2encoding(code), )
+ return super(Family, self).encodings(code)
diff --git a/pywikibot/family.py b/pywikibot/family.py
index abe13db..935ab25 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1382,22 +1382,24 @@
return 10
return 1000 * int(M.group(1)) + int(M.group(2)) - 1000
- def code2encoding(self, code):
+ def encoding(self, code):
"""Return the encoding for a specific language
wiki."""
return 'utf-8'
- def code2encodings(self, code):
- """Return list of historical encodings for a specific language
Wiki."""
- return (self.code2encoding(code), )
+ def encodings(self, code):
+ """Return list of historical encodings for a specific language
wiki."""
+ return (self.encoding(code), )
# aliases
- def encoding(self, code):
- """Return the encoding for a specific language
Wiki."""
- return self.code2encoding(code)
+ @deprecated('Site().encoding()', since='20200218')
+ def code2encoding(self, code):
+ """Return the encoding for a specific language
wiki."""
+ return self.encoding(code)
- def encodings(self, code):
- """Return list of historical encodings for a specific language
Wiki."""
- return self.code2encodings(code)
+ @deprecated('Site().encodings()', since='20200218')
+ def code2encodings(self, code):
+ """Return list of historical encodings for a specific language
wiki."""
+ return self.encodings(code)
def __eq__(self, other):
"""Compare self with other.
--
To view, visit
https://gerrit.wikimedia.org/r/572935
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: I9879066b3b27621b0b0b1051daa51ab2166b6a27
Gerrit-Change-Number: 572935
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)