jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1323990?usp=email )
Change subject: docs: Fix additional typos
......................................................................
docs: Fix additional typos
Correct spelling and grammar errors in comments, docstrings, help text,
and test descriptions.
Change-Id: Ib73f9df17c9e6518257c46258ae87362e86ab695
---
M pywikibot/bot_choice.py
M pywikibot/data/superset.py
M pywikibot/date.py
M pywikibot/family.py
M pywikibot/logentries.py
M pywikibot/page/_basepage.py
M pywikibot/page/_filepage.py
M pywikibot/scripts/wrapper.py
M pywikibot/site/_apisite.py
M pywikibot/site/_generators.py
M pywikibot/site/_siteinfo.py
M pywikibot/tools/formatter.py
M pywikibot/version.py
M scripts/add_text.py
M scripts/checkimages.py
M scripts/commonscat.py
M scripts/interwiki.py
M scripts/transwikiimport.py
M tests/api_tests.py
M tests/file_tests.py
M tests/http_tests.py
M tests/interwikidata_tests.py
M tests/link_tests.py
M tests/proofreadpage_tests.py
M tests/tools_threading_tests.py
25 files changed, 38 insertions(+), 38 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index c3a0b6a..107fe68 100644
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -640,7 +640,7 @@
(The boolean values are the default values)
It has also a ``context`` attribute which must be a non-negative
- integer. If it is greater 0 it shows that many characters before and
+ integer. If it is greater than 0 it shows that many characters before and
after the link in question. The ``context_delta`` attribute can be
defined too and adds an option to increase ``context`` by the given
amount each time the option is selected.
diff --git a/pywikibot/data/superset.py b/pywikibot/data/superset.py
index 78a37d9..8714cd8 100644
--- a/pywikibot/data/superset.py
+++ b/pywikibot/data/superset.py
@@ -92,7 +92,7 @@
url = f'{self.superset_url}/login/mediawiki?next='
self.last_response = http.fetch(url)
- # Test if uset has been successfully logged in
+ # Test if user has been successfully logged in
url = f'{self.superset_url}/api/v1/me/'
try:
self.last_response = http.fetch(url)
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 9a2a028..0df0024 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -181,7 +181,7 @@
def dh_centuryBC(value: int, pattern: str) -> str:
- """Helper for decoding an BC century."""
+ """Helper for decoding a BC century."""
return dh_noConv(value, pattern, formatLimits['CenturyBC'][0])
@@ -191,7 +191,7 @@
def dh_millenniumBC(value: int, pattern: str) -> str:
- """Helper for decoding an BC millennium."""
+ """Helper for decoding a BC millennium."""
return dh_noConv(value, pattern, formatLimits['MillenniumBC'][0])
@@ -2015,7 +2015,7 @@
add_overlap: bool = False) -> datetime.date:
"""Add or subtract months from the date.
- By default if the new month has less days then the day of the date
+ By default if the new month has fewer days than the day of the date
it chooses the last day in the new month. For example a date in the
March 31st added by one month will result in April 30th.
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 365b0d9..9ae3a97 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -613,7 +613,7 @@
determine which code applies.
.. version-changed:: 10.0
- *url* parameter does not have to contain a api/query/script
+ *url* parameter does not have to contain an API/query/script
path
.. version-changed:: 10.3
accept a trailing slash in *url* after domain.
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index 143023c..f487f3b 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -212,7 +212,7 @@
"""Return old rights groups.
.. version-changed:: 7.5
- No longer raise KeyError if `oldgroups` does not exists or
+ No longer raise KeyError if `oldgroups` does not exist or
LogEntry has no additional data e.g. due to hidden data and
insufficient rights.
"""
@@ -223,7 +223,7 @@
"""Return new rights groups.
.. version-changed:: 7.5
- No longer raise KeyError if `oldgroups` does not exists or
+ No longer raise KeyError if `newgroups` does not exist or
LogEntry has no additional data e.g. due to hidden data and
insufficient rights.
"""
diff --git a/pywikibot/page/_basepage.py b/pywikibot/page/_basepage.py
index b11cced..fbf3af0 100644
--- a/pywikibot/page/_basepage.py
+++ b/pywikibot/page/_basepage.py
@@ -380,7 +380,7 @@
.. version-changed:: 9.2
:exc:`exceptions.SectionError` is raised if the
- :meth:`section` does not exists
+ :meth:`section` does not exist
.. seealso:: :attr:`text` property
:param force: Reload all page attributes, including errors.
diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py
index f7212ff..3aba42e 100644
--- a/pywikibot/page/_filepage.py
+++ b/pywikibot/page/_filepage.py
@@ -420,7 +420,7 @@
# adjust user path
path = path.expanduser()
# use read throttle per Wikitech robot policy for download (T418672)
- # multiply minthrottle by 25 to get an functional delay
+ # multiply minthrottle by 25 to get a functional delay
self.site.throttle.set_delays(delay=25 * self.site.throttle.delay)
self.site.throttle()
self.site.throttle.set_delays()
diff --git a/pywikibot/scripts/wrapper.py b/pywikibot/scripts/wrapper.py
index 1efdf03..0534a5e 100755
--- a/pywikibot/scripts/wrapper.py
+++ b/pywikibot/scripts/wrapper.py
@@ -353,7 +353,7 @@
for folder in script_paths:
if not folder.exists():
warning(
- f'{folder} does not exists; remove it from user_script_paths')
+ f'{folder} does not exist; remove it from user_script_paths')
continue
for script_name in folder.iterdir():
name, suffix = script_name.stem, script_name.suffix
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 4159c97..5463714 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -2690,7 +2690,7 @@
be a FilePage.
:raises TypeError: *oldimage* option is given but page object is
neither a page id nor a :class:`pywikibot.FilePage`.
- :raises NoPageError: the *page* does not exists.
+ :raises NoPageError: the *page* does not exist.
:raises Error: Any of the following conditions occurred:
noapiwrite, writeapidenied, permissiondenied, cantdelete,
nodeleteablefile.
diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index 7277e62..6b57289 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -2100,7 +2100,7 @@
to be patrolled.
:param revid: An int/string/iterable/iterator providing revid of pages
to be patrolled.
- :param revision: An Revision/iterable/iterator providing Revision
+ :param revision: A Revision/iterable/iterator providing Revision
object of pages to be patrolled.
"""
# If patrol is not enabled, attr will be set the first time a
diff --git a/pywikibot/site/_siteinfo.py b/pywikibot/site/_siteinfo.py
index b1a58ce..3ca94cd 100644
--- a/pywikibot/site/_siteinfo.py
+++ b/pywikibot/site/_siteinfo.py
@@ -274,7 +274,7 @@
.. seealso:: :py:obj:`_get_siteinfo`
:param key: The name of the siteinfo property.
- :param get_default: Whether to throw an KeyError if the key is invalid.
+ :param get_default: Whether to throw a KeyError if the key is invalid.
:param cache: Caches the result internally so that future accesses via
this method won't query the server.
:param expiry: If the cache is older than the expiry it ignores the
diff --git a/pywikibot/tools/formatter.py b/pywikibot/tools/formatter.py
index 3d8defa..be7f8ba 100644
--- a/pywikibot/tools/formatter.py
+++ b/pywikibot/tools/formatter.py
@@ -44,7 +44,7 @@
def out(self):
"""Create the text with one item on each line."""
if self.sequence:
- # Width is only defined when the length is greater 0
+ # Width is only defined when the length is greater than 0
width = int(math.log10(len(self.sequence))) + 1
content = self.separator.join(
self.format_string.format(index=i, item=item, width=width)
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 561cdd5..8d4e272 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -246,7 +246,7 @@
It uses the __file__ attribute of the module. If it's file extension
ends with py and another character the last character is discarded
- when the py file exist.
+ when the py file exists.
:param module: The module instance.
:type module: module
diff --git a/scripts/add_text.py b/scripts/add_text.py
index 0642f27..28a1d33 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -133,7 +133,7 @@
self.generator, return_talk_only=True)
def skip_page(self, page: pywikibot.Page) -> bool:
- """Skip if -exceptUrl matches or page does not exists."""
+ """Skip if -exceptUrl matches or page does not exist."""
if page.exists():
if self.opt.createonly:
pywikibot.warning(f'Skipping because {page} already exists')
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index ae781f9..90c80e0 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -361,8 +361,8 @@
'sr': 'User:KizuleBot/checkimages.py/дозвољенишаблони',
}
-# Template added when the bot finds only an hidden template and nothing else.
-# Note: every __botnick__ will be repleaced with your bot's nickname
+# Template added when the bot finds only a hidden template and nothing else.
+# Note: every __botnick__ will be replaced with your bot's nickname
# (feel free not to use if you don't need it)
HIDDEN_TEMPALTE_NOTIFICATION = {
'commons': ("\n{{subst:User:Filnik/whitetemplate|File:%s}}\n\n''This "
@@ -660,7 +660,7 @@
def put_mex_in_talk(self) -> None:
"""Function to put the warning in talk page of the uploader.
- When the bot find that the usertalk is empty it adds the welcome
+ When the bot finds that the usertalk is empty it adds the welcome
message first. The messages are imported from welcome.py script.
"""
email_page_name = i18n.translate(self.site, EMAIL_PAGE_WITH_TEXT)
@@ -933,7 +933,7 @@
" or in the dupe's page. Skip.")
return False # Ok - Let's continue the checking phase
- # true if the image are not to be tagged as dupes
+ # true if the image is not to be tagged as a duplicate
only_report = False
# put only one image or the whole list according to the request
@@ -1300,7 +1300,7 @@
return False
skip_number = min(skip_number, limit)
- # Print a starting message only if no images has been skipped
+ # Print a starting message only if no images have been skipped
if not self.skip_list:
pywikibot.info(
i18n.translate(
@@ -1437,7 +1437,7 @@
# The header of the Unknown extension's message.
dih = i18n.twtranslate(self.site, 'checkimages-unknown-extension-head')
- # Text that will be add if the bot find a unknown extension.
+ # Text that will be added if the bot finds an unknown extension.
din = i18n.twtranslate(self.site,
'checkimages-unknown-extension-msg') + ' ~~~~'
# Header that the bot will add if the image hasn't the license.
diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index 5d54b6b..9ce1428 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -462,7 +462,7 @@
"""Return the name of a valid commons category.
If the page is a redirect this function tries to follow it. If
- the page doesn't exists the function will return an empty string
+ the page doesn't exist the function will return an empty string
"""
if not name: # target name is empty
return ''
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 4225ee6..81995b9 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -1017,7 +1017,7 @@
return (False, None)
def isIgnored(self, page) -> bool:
- """Return True if pages is to be ignored."""
+ """Return True if page is to be ignored."""
code = page.site.code
if code in self.conf.neverlink:
diff --git a/scripts/transwikiimport.py b/scripts/transwikiimport.py
index cc8c347..4e5a3d9 100755
--- a/scripts/transwikiimport.py
+++ b/scripts/transwikiimport.py
@@ -128,7 +128,7 @@
Hints
-----
-The list of wikis that can be used as a interwiki source is defined in
+The list of wikis that can be used as an interwiki source is defined in
the variable ``$wgImportSources``. It can be viewed on the
``Special:Import`` page.
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 81d0fe4..86c90f6 100755
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -74,7 +74,7 @@
'Instead of using kwargs |Both kwargs and parameters are set',
DeprecationWarning)
def test_mixed_mode(self) -> None:
- """Test if parameters is used with kwargs."""
+ """Test using parameters with kwargs."""
req1 = api.Request(site=self.site, action='test', parameters='foo')
self.assertIn('parameters', req1._params)
diff --git a/tests/file_tests.py b/tests/file_tests.py
index 0684ee7..6fe4e4f 100755
--- a/tests/file_tests.py
+++ b/tests/file_tests.py
@@ -476,7 +476,7 @@
def test_edit_label(self) -> None:
"""Test label editing."""
- # Test label editing when file doesn't exists
+ # Test label editing when file doesn't exist
page = pywikibot.FilePage(self.site, 'File:123_4_DOESNT_EXISTS.jpg')
item = page.data_item()
error_message = "Entity '-1' doesn't exist on commons:beta"
diff --git a/tests/http_tests.py b/tests/http_tests.py
index 2044b21..208e3ba 100755
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -144,7 +144,7 @@
def test_invalid_scheme(self) -> None:
"""Test invalid scheme."""
- # A InvalidSchema is raised within requests
+ # An InvalidSchema is raised within requests
with self.assertRaisesRegex(
FatalServerError,
"No connection adapters were found for 'invalid://url'"):
diff --git a/tests/interwikidata_tests.py b/tests/interwikidata_tests.py
index cde9ce7..1269d99 100755
--- a/tests/interwikidata_tests.py
+++ b/tests/interwikidata_tests.py
@@ -62,7 +62,7 @@
if site.has_data_repository:
with empty_sites():
- # The main function return None.
+ # The main function returns None.
self.assertIsNone(interwikidata.main())
else:
with empty_sites(), self.assertRaisesRegex(
diff --git a/tests/link_tests.py b/tests/link_tests.py
index c68df20..4941b15 100755
--- a/tests/link_tests.py
+++ b/tests/link_tests.py
@@ -865,7 +865,7 @@
self.assertTrue(link._is_interwiki)
def test_other_wiki_prefix(self) -> None:
- """Test that Link fails if the interwiki prefix is a unknown family.
+ """Test that Link fails if the interwiki prefix is an unknown family.
Sometimes *bulba* does not return a json content but a security
script. api.Request._json_loads raises a
diff --git a/tests/proofreadpage_tests.py b/tests/proofreadpage_tests.py
index 604a650..4830fa5 100755
--- a/tests/proofreadpage_tests.py
+++ b/tests/proofreadpage_tests.py
@@ -820,13 +820,13 @@
# Get label from number.
self.assertEqual(index_page.get_label_from_page_number(num), label)
- # Error if number does not exists.
+ # Error if number does not exist.
with self.assertRaises(KeyError):
index_page.get_label_from_page_number(-1)
# Get label from page.
self.assertEqual(index_page.get_label_from_page(proofread_page), label)
- # Error if page does not exists.
+ # Error if page does not exist.
with self.assertRaises(KeyError):
index_page.get_label_from_page(None)
@@ -861,7 +861,7 @@
n = index_page.get_number(p)
self.assertEqual(index_page.get_page(n), p)
- # Error if label does not exists.
+ # Error if label does not exist.
with self.assertRaises(KeyError):
index_page.get_page_number_from_label('dummy label')
@@ -995,18 +995,18 @@
self.assertFalse(self.index.has_valid_content())
def test_has_valid_content_misnamed_template(self) -> None:
- """Test nested templates is valid."""
+ """Test a misnamed template is invalid."""
self.index.text = '{{%s_bar|foo=bar}}' % IndexPage.INDEX_TEMPLATE
self.assertFalse(self.index.has_valid_content())
def test_has_valid_content_nested_template(self) -> None:
- """Test nested templates is valid."""
+ """Test a nested template is valid."""
self.index.text = ('{{%s|foo=%s}}'
% (IndexPage.INDEX_TEMPLATE, self.other_template))
self.assertTrue(self.index.has_valid_content())
def test_has_valid_content_multiple_valid(self) -> None:
- """Test multiple Index templates is invalid."""
+ """Test multiple Index templates are invalid."""
self.index.text = self.valid_template * 2
self.assertFalse(self.index.has_valid_content())
diff --git a/tests/tools_threading_tests.py b/tests/tools_threading_tests.py
index 1110bd3..7d6afd2 100755
--- a/tests/tools_threading_tests.py
+++ b/tests/tools_threading_tests.py
@@ -71,7 +71,7 @@
pool._max_workers)
def test_class(self) -> None:
- """Test string and repr methods for a executor class."""
+ """Test string and repr methods for an executor class."""
executors = [ThreadPoolExecutor, ProcessPoolExecutor]
if PYTHON_VERSION >= (3, 14):
from concurrent.futures import InterpreterPoolExecutor
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1323990?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: Ib73f9df17c9e6518257c46258ae87362e86ab695
Gerrit-Change-Number: 1323990
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[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]