fix(repo): ruff fixes / removing pylint exceptions
This commit is contained in:
parent
e34d621e6d
commit
858a1bae8a
12 changed files with 51 additions and 56 deletions
|
@ -17,7 +17,6 @@ from redbot.core.bot import Red
|
|||
from redbot.core.utils.chat_formatting import error, 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."""
|
||||
|
||||
|
@ -130,7 +129,7 @@ class Backup(commands.Cog):
|
|||
try:
|
||||
repository = await downloader._repo_manager.add_repo(
|
||||
url, name, branch
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
repo_s.append(
|
||||
f"Added repository {name} from {url} on branch {branch}."
|
||||
)
|
||||
|
@ -142,7 +141,7 @@ class Backup(commands.Cog):
|
|||
repo_e.append(f"Repository {name} already exists.")
|
||||
repository = downloader._repo_manager.get_repo(
|
||||
name
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
self.logger.debug("Repository %s already exists", name)
|
||||
|
||||
# This is commented out because errors.AuthenticationError is not yet implemented in Red 3.5.5's Downloader cog.
|
||||
|
@ -200,7 +199,7 @@ class Backup(commands.Cog):
|
|||
await ctx.bot.remove_loaded_package(cog)
|
||||
await downloader._delete_cog(
|
||||
poss_installed_path
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
uninstall_s.append(f"Uninstalled {cog}")
|
||||
self.logger.debug("Uninstalled %s", cog)
|
||||
else:
|
||||
|
@ -208,7 +207,7 @@ class Backup(commands.Cog):
|
|||
self.logger.warning("Failed to uninstall %s", cog)
|
||||
await downloader._remove_from_installed(
|
||||
cog_modules
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
|
||||
for cog in cogs:
|
||||
cog_name = cog["name"]
|
||||
|
@ -229,14 +228,14 @@ class Backup(commands.Cog):
|
|||
await downloader._filter_incorrect_cogs_by_names(
|
||||
repository, [cog_name]
|
||||
)
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
if not cogs_c:
|
||||
install_e.append(message)
|
||||
self.logger.error(message)
|
||||
continue
|
||||
failed_reqs = await downloader._install_requirements(
|
||||
cogs_c
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
if failed_reqs:
|
||||
install_e.append(
|
||||
f"Failed to install {cog_name} due to missing requirements: {failed_reqs}"
|
||||
|
@ -250,7 +249,7 @@ class Backup(commands.Cog):
|
|||
|
||||
installed_cogs, failed_cogs = await downloader._install_cogs(
|
||||
cogs_c
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
|
||||
if repository.available_libraries:
|
||||
installed_libs, failed_libs = (
|
||||
|
@ -271,7 +270,7 @@ class Backup(commands.Cog):
|
|||
installed_cogs + installed_libs
|
||||
if installed_libs
|
||||
else installed_cogs
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
if installed_cogs:
|
||||
installed_cog_name = installed_cogs[0].name
|
||||
install_s.append(f"Installed {installed_cog_name}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue