feat(repo): added help formatters for version numbers to cogs that have them and migrated to using red's inbuilt loggers instead of logging.getLogger
Some checks failed
Actions / Lint Code (Ruff & Pylint) (push) Failing after 31s
Actions / Build Documentation (MkDocs) (push) Successful in 26s

This commit is contained in:
SeaswimmerTheFsh 2024-03-07 03:38:34 -05:00
parent ae31a61436
commit 178a92559c
Signed by: cswimr
GPG key ID: B8953EC01E5C4063
6 changed files with 62 additions and 30 deletions

View file

@ -7,27 +7,38 @@
import contextlib
import json
import logging
import re
from red_commons.logging import getLogger
from redbot.cogs.downloader import errors
from redbot.cogs.downloader.converters import InstalledCog
from redbot.core import commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import error, text_to_file
from redbot.core.utils.chat_formatting import (error, humanize_list,
text_to_file)
# pylint: disable=protected-access
class Backup(commands.Cog):
"""A utility to make reinstalling repositories and cogs after migrating the bot far easier."""
__author__ = "SeaswimmerTheFsh"
__version__ = "1.0.0"
__author__ = ["SeaswimmerTheFsh"]
__version__ = "1.0.1"
def __init__(self, bot: Red):
super().__init__()
self.bot = bot
self.logger = logging.getLogger("red.seacogs.backup")
self.logger = getLogger("red.seacogs.backup")
def format_help_for_context(self, ctx: commands.Context) -> str:
pre_processed = super().format_help_for_context(ctx) or ""
n = "\n" if "\n\n" not in pre_processed else ""
text = [
f"{pre_processed}{n}",
f"Cog Version: **{self.__version__}**",
f"Author: {humanize_list(self.__author__)}",
]
return "\n".join(text)
@commands.group(autohelp=True)
@commands.is_owner()