Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
patch detached from Ibef01b1c705ec560cafa7bc71feca7f5a0824037

Change-Id: I5ffef06e14ca11e77667d51a8ff1327fda76ca1b
  • Loading branch information
JJMC89 authored and xqt committed Jul 30, 2024
1 parent 8f8691c commit 541a67f
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 18 deletions.
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ Code of Conduct

The development of this software is covered by a
`Code of Conduct <https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct>`_.

1 change: 0 additions & 1 deletion docs/api_ref/family.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@
cls.code_aliases = aliases
.. versionadded:: 8.3

2 changes: 1 addition & 1 deletion docs/api_ref/i18n_plural.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
***********************************

.. automodule:: plural
:synopsis: Module containing plural rules of various languages
:synopsis: Module containing plural rules of various languages
1 change: 0 additions & 1 deletion docs/scripts/archive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,3 @@ As alternative, if '-ocr' option is selected,
OCR tool will be used to get text.
In this case, also already existing pages with quality value 'Not Proofread'
can be treated. '-force' will override existing page in this case.

1 change: 0 additions & 1 deletion docs/scripts/categories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ commonscat script
.. automodule:: scripts.commonscat
:no-members:
:noindex:

1 change: 0 additions & 1 deletion docs/scripts/outdated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,3 @@ warnfile script

A robot to implement backlinks from an interwiki.log file without checking
them against the live wikipedia.

1 change: 0 additions & 1 deletion pywikibot/CONTENT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,3 @@ The contents of the package
+----------------------------+------------------------------------------------------+
| README.rst | Package description file |
+----------------------------+------------------------------------------------------+

10 changes: 5 additions & 5 deletions pywikibot/proofreadpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def __repr__(self):
return f"{self.__class__.__name__}('{self}')"


def decompose(fn: Callable) -> Callable: # type: ignore
def decompose(fn: Callable) -> Callable:
"""Decorator for ProofreadPage.
Decompose text if needed and recompose text.
Expand All @@ -335,7 +335,7 @@ def wrapper(self: ProofreadPage, *args: Any, **kwargs: Any) -> Any:
return wrapper


def check_if_cached(fn: Callable) -> Callable: # type: ignore
def check_if_cached(fn: Callable) -> Callable:
"""Decorator for IndexPage to ensure data is cached."""

def wrapper(self: IndexPage, *args: Any, **kwargs: Any) -> Any:
Expand Down Expand Up @@ -818,7 +818,7 @@ def _url_image_lt_140(self) -> str:
pywikibot.error(f'Error fetching HTML for {self}.')
raise

soup = _bs4_soup(response.text) # type: ignore
soup = _bs4_soup(response.text)

try:
url_image = soup.find(class_='prp-page-image')
Expand Down Expand Up @@ -1149,7 +1149,7 @@ def _get_page_mappings(self) -> None:
self._pages_from_label: dict[str, set[pywikibot.Page]] = {}
self._labels_from_page_number: dict[int, str] = {}
self._labels_from_page: dict[pywikibot.page.Page, str] = {}
self._soup = _bs4_soup(self.get_parsed_page(True)) # type: ignore
self._soup = _bs4_soup(self.get_parsed_page(True))
# Do not search for "new" here, to avoid to skip purging if links
# to non-existing pages are present.
attrs = {'class': re.compile('prp-pagequality-[0-4]')}
Expand All @@ -1175,7 +1175,7 @@ def _get_page_mappings(self) -> None:
}
if not found:
self.purge()
self._soup = _bs4_soup(self.get_parsed_page(True)) # type: ignore
self._soup = _bs4_soup(self.get_parsed_page(True))
if not self._soup.find_all('a', attrs=attrs):
raise ValueError(
'Missing class="qualityN prp-pagequality-N" or '
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
# Add all dependencies as test dependencies,
# so all scripts can be compiled for script_tests, etc.
if 'PYSETUP_TEST_EXTRAS' in os.environ: # pragma: no cover
test_deps += [i for k, v in extra_deps.items() if k != 'flake8' for i in v]
test_deps += [i for v in extra_deps.values() for i in v]

# These extra dependencies are needed other unittest fails to load tests.
test_deps += extra_deps['eventstreams']
Expand Down
2 changes: 1 addition & 1 deletion tests/i18n/test/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"test-non-localized": "test-non-localized EN",
"test-plural": "Bot: Changing %(num)s {{PLURAL:%(num)d|page|pages}}.",
"test-semi-localized": "test-semi-localized EN"
}
}
2 changes: 1 addition & 1 deletion tests/i18n/test/fr.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"test-plural": "Robot: Changer %(descr)s {{PLURAL:num|une page|quelques pages}}."
}
}
2 changes: 1 addition & 1 deletion tests/i18n/test/fy.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"test-localized": "test-localized FY"
}
}
2 changes: 1 addition & 1 deletion tests/i18n/test/ja.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"test-no-english": "test-no-english JA"
}
}
2 changes: 1 addition & 1 deletion tests/i18n/test/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"test-localized": "test-localized NL",
"test-plural": "Bot: Pas {{PLURAL:num|1 pagina|%(num)d pagina's}} aan.",
"test-semi-localized": "test-semi-localized NL"
}
}

0 comments on commit 541a67f

Please sign in to comment.