Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretties up the output when libraries fail to install #2576

Merged
merged 4 commits into from Apr 23, 2019
Merged

Pretties up the output when libraries fail to install #2576

merged 4 commits into from Apr 23, 2019

Conversation

@Flame442
Copy link
Member

@Flame442 Flame442 commented Apr 12, 2019

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Fixes #2575

Previously, when a cog failed to install libraries, the resulting message would print the raw list of requirements. This PR changes that message to comma separate those libraries in order to look nicer.

Example before:

Before

Example after:

After

@jack1142
Copy link
Member

@jack1142 jack1142 commented Apr 12, 2019

Your code's completely fine, but I just wanted to let you know, that we have inline and humanize_list functions (you can see, that we use those in other places in downloader) in redbot.core.utils.chat_formatting, where inline adds inline formatting to string and also makes sure to use double ticks, when tick is already in the text (that doesn't matter here, but just wanted to point that out) and humanize_list functions (you can see, that we use those in other places in downloader) gives you comma-separated list, with the last element joined with and.
Link to docs:

We use those in other places where we send cogs or libraries names, so it might be better to use it.

You can use them together like that (it's used like this in all other places in downloader):

humanize_list(tuple(map(inline, cog.requirements)))

or like that (that doesn't require converting map to tuple, so might be better, but since map is used everywhere, I'm not so sure, if it's better):

humanize_list([inline(req) for req in cog.requirements])

Loading

@tekulvw tekulvw merged commit 8555f8c into Cog-Creators:V3/develop Apr 23, 2019
1 check passed
Loading
@Flame442 Flame442 deleted the patch-2 branch May 7, 2019
@jack1142 jack1142 added this to the 3.1.0 milestone Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants