[Commands] Allow custom checks to add attributes to the Command instance #60

Merged
Gnome-py merged 2 commits from command-attrs-checks into 2.0 2021-09-21 18:47:28 +00:00
Gnome-py commented 2021-09-06 18:53:53 +00:00 (Migrated from github.com)

Summary

This adds the command_attrs parameter to the commands.check decorator and reworks a lot of checks in order to allow introspection later of attributes like Command.required_permissions.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)
<!-- Pull requests that do not fill this information in will likely be closed --> ## Summary <!-- What is this pull request for? Does it fix any issues? --> This adds the `command_attrs` parameter to the `commands.check` decorator and reworks a lot of checks in order to allow introspection later of attributes like `Command.required_permissions`. ## Checklist <!-- Put an x inside [ ] to check it, like so: [x] --> - [x] If code changes were made then they have been tested. - [x] I have updated the documentation to reflect the changes. - [ ] This PR fixes an issue. - [x] This PR adds something new (e.g. new method or parameters). - [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed) - [ ] This PR is **not** a code change (e.g. documentation, README, ...)
TheMoksej (Migrated from github.com) approved these changes 2021-09-06 21:16:28 +00:00
Daggy1234 commented 2021-09-07 02:55:01 +00:00 (Migrated from github.com)

I'm confused as to why this exists, adding command attrs inside a check seems like a niche usecase, does the library really need to handle this

I'm confused as to why this exists, adding command attrs inside a check seems like a niche usecase, does the library really need to handle this
Gnome-py commented 2021-09-07 14:58:24 +00:00 (Migrated from github.com)

This is so things like Command.required_permissions is possible to access + allow user checks to add similar attributes

This is so things like `Command.required_permissions` is possible to access + allow user checks to add similar attributes
Sign in to join this conversation.
No description provided.