jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1300112?usp=email )
Change subject: [Bugfix] Fix spelling mistakes and simplyfy
APISite._build_namespaces()
......................................................................
[Bugfix] Fix spelling mistakes and simplyfy APISite._build_namespaces()
Change-Id: I2346cad962689482328ffd60c70b2b4ec8589b41
---
M pywikibot/page/_wikibase.py
M pywikibot/site/_apisite.py
M scripts/replace.py
M tests/api_tests.py
4 files changed, 9 insertions(+), 11 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py
index cb6b807..105c484 100644
--- a/pywikibot/page/_wikibase.py
+++ b/pywikibot/page/_wikibase.py
@@ -1896,7 +1896,7 @@
"""Create a Claim for a qualifier from JSON.
Qualifier objects are represented a bit differently like
- references, but I'm not sure if this even requires it's own
+ references, but I'm not sure if this even requires its own
function.
:rtype: pywikibot.page.Claim
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 113e1a2..772da46 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -166,7 +166,7 @@
guaranteed to equal ``site`` (i.e. the parameter passed to this
function).
- :param site: The targeted site, which might be it's own.
+ :param site: The targeted site, which might be its own.
:raises KeyError: If there is no interwiki prefix for that site.
"""
assert site is not None, 'Site must not be None'
@@ -929,7 +929,7 @@
:param is_ts: When comparing timestamps (with is_ts=True) the
start is usually greater than end. Comparing titles this is
vice versa.
- :raises AssertionError: Start/end values are not comparabel
+ :raises AssertionError: Start/end values are not comparable
types or are in the wrong order
"""
if not (isinstance(end, type(start)) or isinstance(start, type(end))):
@@ -1195,11 +1195,10 @@
for nsdata in self.siteinfo.get('namespaces', cache=False).values():
ns = nsdata.pop('id')
+ custom_name = nsdata.pop('name')
if ns == 0:
- custom_name = canonical_name = nsdata.pop('name')
- custom_name = canonical_name
+ canonical_name = custom_name
else:
- custom_name = nsdata.pop('name')
canonical_name = nsdata.pop('canonical')
default_case = Namespace.default_case(ns)
@@ -1385,7 +1384,7 @@
site.
.. version-changed:: 11.0
No longer raise UnknownExtensionError if site is not
- connected to a wikibase but retern None instead.
+ connected to a wikibase but return None instead.
:param item: Id number of item, "Q###",
:return: Page, or Category object given by Wikibase item number
@@ -1859,7 +1858,7 @@
return category._catinfo
def isBot(self, username: str) -> bool: # noqa: N802
- """Return True is username is a bot user."""
+ """Return True if username is a bot user."""
return username in (userdata['name'] for userdata in self.botusers())
@property
diff --git a/scripts/replace.py b/scripts/replace.py
index 25b752d..ef77ce8 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -284,7 +284,7 @@
class Replacement(ReplacementBase):
- """A single replacement with it's own data."""
+ """A single replacement with its own data."""
def __init__(self, old, new, use_regex=None, exceptions=None,
case_insensitive=None, edit_summary=None,
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 93a7622..1eaa446 100755
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -756,8 +756,7 @@
"""Test that it tries to login when read API access is denied.
Because there is no such family configured it creates an AutoFamily
- and BaseSite on it's own. It's testing against
- steward.wikimedia.org.
+ and BaseSite on its own. It's testing against steward.wikimedia.org.
These tests are split into two subclasses as only the first failed
login behaves as expected. All subsequent logins will raise an
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1300112?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I2346cad962689482328ffd60c70b2b4ec8589b41
Gerrit-Change-Number: 1300112
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]