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

Conversation

@Flame442
Copy link
Member

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

@Flame442 Flame442 requested a review from tekulvw as a code owner Apr 12, 2019

@jack1142

This comment has been minimized.

Copy link
Contributor

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])

Flame442 added some commits Apr 12, 2019

jack1142 added a commit to jack1142/Red-DiscordBot that referenced this pull request Apr 13, 2019

refactor(downloader): humanize cog.requirements list before sending
This will probably get implemented before this PR in Cog-Creators#2576, so it's only for later update with
upstream

fix Cog-Creators#2575

@tekulvw tekulvw merged commit 8555f8c into Cog-Creators:V3/develop Apr 23, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

kennnyshiwa pushed a commit to kennnyshiwa/BB-8-Bot that referenced this pull request Apr 23, 2019

[Downloader] Pretties up the output when libraries fail to install (C…
…og-Creators#2576)

* Pretties up the output when libraries fail to install

* Stupid double quote bullshit

* Added jack1142's suggestion

* I will never satisfy the eldritch being named black

@Flame442 Flame442 deleted the Flame442:patch-2 branch May 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.