aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2021-03-04 21:49:38 +0100
committerGravatar Numerlor <[email protected]>2021-03-05 01:42:28 +0100
commitf993a11c0461e57e853dfc0e296fc32dcfc2b265 (patch)
treefd577f539ea2f15f1a8ecc9f29dda2d2df11dda3
parentMove the seconds of a week timedelta into a constant (diff)
Typo and docstring style changes
Co-authored-by: MarkKoz <[email protected]> fixup! Docstring typos and style changes
-rw-r--r--bot/converters.py2
-rw-r--r--bot/exts/info/doc/_batch_parser.py6
-rw-r--r--bot/exts/info/doc/_cog.py4
-rw-r--r--bot/exts/info/doc/_html.py8
-rw-r--r--bot/utils/lock.py2
5 files changed, 11 insertions, 11 deletions
diff --git a/bot/converters.py b/bot/converters.py
index be1f1329f..4fbf3c124 100644
--- a/bot/converters.py
+++ b/bot/converters.py
@@ -140,7 +140,7 @@ class PackageName(Converter):
async def convert(cls, ctx: Context, argument: str) -> str:
"""Checks whether the given string is a valid package name."""
if cls.PACKAGE_NAME_RE.search(argument):
- raise BadArgument("The provided package name is not valid; please only use the _, 0-9 and a-z characters.")
+ raise BadArgument("The provided package name is not valid; please only use the _, 0-9, and a-z characters.")
return argument
diff --git a/bot/exts/info/doc/_batch_parser.py b/bot/exts/info/doc/_batch_parser.py
index 95538f364..45ca17e5e 100644
--- a/bot/exts/info/doc/_batch_parser.py
+++ b/bot/exts/info/doc/_batch_parser.py
@@ -46,7 +46,7 @@ class StaleInventoryNotifier:
class QueueItem(NamedTuple):
- """Contains a doc_item and the BeautifulSoup object needed to parse it."""
+ """Contains a `DocItem` and the `BeautifulSoup` object needed to parse it."""
doc_item: _cog.DocItem
soup: BeautifulSoup
@@ -120,7 +120,7 @@ class BatchParser:
)
self._queue.extendleft(QueueItem(item, soup) for item in self._page_doc_items[doc_item.url])
- log.debug(f"Added items from {doc_item.url} to parse queue.")
+ log.debug(f"Added items from {doc_item.url} to the parse queue.")
if self._parse_task is None:
self._parse_task = asyncio.create_task(self._parse_queue())
@@ -181,7 +181,7 @@ class BatchParser:
"""
Clear all internal symbol data.
- All currently requested items are waited to be parsed before clearing.
+ Wait for all user-requested symbols to be parsed before clearing the parser.
"""
for future in filter(attrgetter("user_requested"), self._item_futures.values()):
await future
diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py
index 0c255c449..8300f11d1 100644
--- a/bot/exts/info/doc/_cog.py
+++ b/bot/exts/info/doc/_cog.py
@@ -83,10 +83,10 @@ class DocCog(commands.Cog):
Build the inventory for a single package.
Where:
- * `package_name` is the package name to use, appears in the log
+ * `package_name` is the package name to use in logs and when qualifying symbols
* `base_url` is the root documentation URL for the specified package, used to build
absolute paths that link to specific symbols
- * `package` are the InventoryDict contents of a intersphinx inventory.
+ * `package` is the content of a intersphinx inventory.
"""
self.base_urls[api_package_name] = base_url
diff --git a/bot/exts/info/doc/_html.py b/bot/exts/info/doc/_html.py
index 701684b88..334b82e98 100644
--- a/bot/exts/info/doc/_html.py
+++ b/bot/exts/info/doc/_html.py
@@ -54,7 +54,7 @@ def _find_elements_until_tag(
limit: int = None,
) -> List[Union[Tag, NavigableString]]:
"""
- Get all elements up to `limit` or until a tag matching `tag_filter` is found.
+ Get all elements up to `limit` or until a tag matching `end_tag_filter` is found.
`end_tag_filter` can be either a container of string names to check against,
or a filtering callable that's applied to tags.
@@ -86,7 +86,7 @@ _find_previous_siblings_until_tag = partial(_find_elements_until_tag, func=Beaut
def _class_filter_factory(class_names: Iterable[str]) -> Callable[[Tag], bool]:
- """Create callable that returns True when the passed in tag's class is in `class_names` or when it's is a table."""
+ """Create callable that returns True when the passed in tag's class is in `class_names` or when it's a table."""
def match_tag(tag: Tag) -> bool:
for attr in class_names:
if attr in tag.get("class", ()):
@@ -100,8 +100,8 @@ def get_general_description(start_element: Tag) -> List[Union[Tag, NavigableStri
"""
Get page content to a table or a tag with its class in `SEARCH_END_TAG_ATTRS`.
- A headerlink tag is attempted to be found to skip repeating the symbol information in the description,
- if it's found it's used as the tag to start the search from instead of the `start_element`.
+ A headerlink tag is attempted to be found to skip repeating the symbol information in the description.
+ If it's found it's used as the tag to start the search from instead of the `start_element`.
"""
child_tags = _find_recursive_children_until_tag(start_element, _class_filter_factory(["section"]), limit=100)
header = next(filter(_class_filter_factory(["headerlink"]), child_tags), None)
diff --git a/bot/utils/lock.py b/bot/utils/lock.py
index b4c93f063..ec6f92cd4 100644
--- a/bot/utils/lock.py
+++ b/bot/utils/lock.py
@@ -23,7 +23,7 @@ class SharedEvent:
"""
Context manager managing an internal event exposed through the wait coro.
- While any code is executing in this context manager, the underyling event will not be set;
+ While any code is executing in this context manager, the underlying event will not be set;
when all of the holders finish the event will be set.
"""