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
This commit is contained in:
parent
ae31a61436
commit
178a92559c
6 changed files with 62 additions and 30 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue