diff options
author | 2021-03-31 20:17:25 +0200 | |
---|---|---|
committer | 2021-03-31 20:17:25 +0200 | |
commit | 220590c7bb6593b06d1796f0807568e06fefa99e (patch) | |
tree | ddd9519107afb9cb2099b92bb1125eba2d1431e9 | |
parent | Branding: target 'main' branch (diff) |
Branding: apply documentation improvements after review
No code changes in this commit.
Co-authored-by: Shivansh-007 <[email protected]>
Co-authored-by: Joe Banks <[email protected]>
-rw-r--r-- | bot/exts/backend/branding/_cog.py | 14 | ||||
-rw-r--r-- | bot/exts/backend/branding/_repository.py | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/bot/exts/backend/branding/_cog.py b/bot/exts/backend/branding/_cog.py index b07edbffd..0a4ddcc88 100644 --- a/bot/exts/backend/branding/_cog.py +++ b/bot/exts/backend/branding/_cog.py @@ -144,7 +144,7 @@ class Branding(commands.Cog): timeout = 10 # Seconds. try: - with async_timeout.timeout(timeout): + with async_timeout.timeout(timeout): # Raise after `timeout` seconds. await pydis.edit(**{asset_type.value: file}) except discord.HTTPException: log.exception("Asset upload to Discord failed.") @@ -160,7 +160,7 @@ class Branding(commands.Cog): """ Apply `banner` to the guild and cache its hash if successful. - Banners should always be applied via this method in order to ensure that the last hash is cached. + Banners should always be applied via this method to ensure that the last hash is cached. Return a boolean indicating whether the application was successful. """ @@ -217,9 +217,9 @@ class Branding(commands.Cog): """ Call `rotate_icons` if the configured amount of time has passed since last rotation. - We offset the calculated time difference into the future in order to avoid off-by-a-little-bit errors. - Because there is work to be done before the timestamp is read and written, the next read will likely - commence slightly under 24 hours after the last write. + We offset the calculated time difference into the future to avoid off-by-a-little-bit errors. Because there + is work to be done before the timestamp is read and written, the next read will likely commence slightly + under 24 hours after the last write. """ log.debug("Checking whether it's time for icons to rotate.") @@ -298,7 +298,7 @@ class Branding(commands.Cog): We cache `event` information to ensure that we: * Remember which event we're currently in across restarts - * Provide an on-demand information embed without re-querying the branding repository + * Provide an on-demand informational embed without re-querying the branding repository An event change should always be handled via this function, as it ensures that the cache is populated. @@ -487,7 +487,7 @@ class Branding(commands.Cog): log.trace("Daemon before: calculating time to sleep before loop begins.") now = datetime.utcnow() - # The actual midnight moment is offset into the future in order to prevent issues with imprecise sleep. + # The actual midnight moment is offset into the future to prevent issues with imprecise sleep. tomorrow = now + timedelta(days=1) midnight = datetime.combine(tomorrow, time(minute=1)) diff --git a/bot/exts/backend/branding/_repository.py b/bot/exts/backend/branding/_repository.py index e6c2396b1..740a4a083 100644 --- a/bot/exts/backend/branding/_repository.py +++ b/bot/exts/backend/branding/_repository.py @@ -19,7 +19,7 @@ if Keys.github: HEADERS["Authorization"] = f"token {Keys.github}" # Since event periods are year-agnostic, we parse them into `datetime` objects with a manually inserted year. -# Please note that this is intentionally a leap year in order to allow Feb 29 to be valid. +# Please note that this is intentionally a leap year to allow Feb 29 to be valid. ARBITRARY_YEAR = 2020 # Format used to parse date strings after we inject `ARBITRARY_YEAR` at the end. |