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

Add util functions extracting end_user_data_statement directly from cog's info.json #4404

Merged
merged 8 commits into from
Sep 29, 2020
Merged

Add util functions extracting end_user_data_statement directly from cog's info.json #4404

merged 8 commits into from
Sep 29, 2020

Conversation

Drapersniper
Copy link
Contributor

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

here is an example usage of this new util.

# In cogs `__init__.py`
from .mycog import MyCog
from redbot.core.utils import get_end_user_statement

__red_end_user_data_statement__  = get_end_user_statement(__file__)

def setup(bot):
    bot.add_cog(MyCog(bot))

This util will attempt to read the statement directly from the cogs info.json and if not successfull it will log a meaningful message to the user letting them know its not possible to do so and at that point it will return None so that the default handling will be handed back to Red (It will mention that this cog does not have an end user data statement in the [p]3rdparty command).

TurnrDev
TurnrDev previously approved these changes Sep 7, 2020
@TurnrDev
Copy link
Contributor

TurnrDev commented Sep 7, 2020

I'm a fan of anything that means I don't have to store the same text twice.

@Jackenmen Jackenmen self-assigned this Sep 19, 2020
@Jackenmen Jackenmen added Category: Core - API - Utils Package This is related to stuff in `redbot.core.utils` Type: Feature New feature or request. labels Sep 19, 2020
@Jackenmen Jackenmen added this to the 3.4.1 milestone Sep 19, 2020
Copy link
Member

@Jackenmen Jackenmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from various grammar stuff and other small issues that I pointed out in review comments, the methods are called get_end_user_statement rather than get_end_user_data_statement which doesn't make that much sense when you read it (as in: it's a statement about end user data, not statement about end user). If you think that it's too long name, I guess we could also call it get_eud_statement, although I'm not really all that convinced that it's a good name.

docs/framework_utils.rst Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
redbot/core/utils/__init__.py Outdated Show resolved Hide resolved
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Drapersniper and others added 3 commits September 28, 2020 12:19
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
@Drapersniper
Copy link
Contributor Author

This should now be ready to merge

Copy link
Member

@Jackenmen Jackenmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jackenmen Jackenmen changed the title Add an extra util to Red that allows CC to fetch end_user_data_statement directly from their info.json Add util functions extracting end_user_data_statement directly from cog's info.json Sep 29, 2020
@Jackenmen Jackenmen merged commit e79aa21 into Cog-Creators:V3/develop Sep 29, 2020
@Cog-CreatorsBot Cog-CreatorsBot added the Changelog Entry: Pending Changelog entry for this PR hasn't been added by repo maintainers yet. label Sep 29, 2020
@Drapersniper Drapersniper deleted the get_end_user_statement branch October 18, 2020 13:55
@Jackenmen Jackenmen added Changelog Entry: Added Changelog entry for this PR has already been added to changelog PR. and removed Changelog Entry: Pending Changelog entry for this PR hasn't been added by repo maintainers yet. labels Oct 18, 2020
@Drapersniper Drapersniper added the QA: Passed Used by few QA members. Has been approved by the assigned QA member(s). label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core - API - Utils Package This is related to stuff in `redbot.core.utils` Changelog Entry: Added Changelog entry for this PR has already been added to changelog PR. QA: Passed Used by few QA members. Has been approved by the assigned QA member(s). Type: Feature New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants