-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
plugin: pluginargument decorator #4747
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
Merged
gravyboat
merged 4 commits into
streamlink:master
from
bastimeyer:plugin/pluginargument
Aug 19, 2022
Merged
plugin: pluginargument decorator #4747
gravyboat
merged 4 commits into
streamlink:master
from
bastimeyer:plugin/pluginargument
Aug 19, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Don't let plugins with no arguments share a common Arguments instance
Use the same signature as the Argument class and initialize the plugin's `arguments` class attribute if it's `None`. Defining plugin arguments the old way is still supported and unchanged.
And clean up some plugin arguments: - Use consistent keyword order - Fix (most) help texts - Fix string indentation and quotation - Logically rearrange some plugin arguments
800c028
to
c72feee
Compare
Billy2011
added a commit
to Billy2011/streamlink-27
that referenced
this pull request
Aug 19, 2022
Don't let plugins with no arguments share a common Arguments instance
This was referenced Aug 19, 2022
Billy2011
added a commit
to Billy2011/streamlink-27
that referenced
this pull request
Aug 28, 2022
Use the same signature as the Argument class and initialize the plugin's `arguments` class attribute if it's `None`. Defining plugin arguments the old way is still supported and unchanged.
Billy2011
added a commit
to Billy2011/streamlink-27
that referenced
this pull request
Aug 28, 2022
And clean up some plugin arguments: - Use consistent keyword order - Fix (most) help texts - Fix string indentation and quotation - Logically rearrange some plugin arguments
Billy2011
added a commit
to Billy2011/streamlink-27
that referenced
this pull request
Sep 3, 2022
Don't let plugins with no arguments share a common Arguments instance
Billy2011
added a commit
to Billy2011/streamlink-27
that referenced
this pull request
Sep 3, 2022
Use the same signature as the Argument class and initialize the plugin's `arguments` class attribute if it's `None`. Defining plugin arguments the old way is still supported and unchanged.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the plugin argument definitions from
to
As mentioned in #4741 (comment), having plugin arguments definied in a similar declarative way as the URL matchers makes it much more consistent and easier to read. The previous definitions were all rather messy.
This also simplifies the parsing of each plugin module's AST via the plugins extension of the docs and the planned URL-cache pre-build step (#4741).
These changes are fully backwards compatible and custom plugins don't need to change anything. I didn't add tests for the old definition style though, but that's not important.
The docs and man page should stay the same, except for the changes of the help texts and some argument rearrangements.
I also fixed some of the help texts, but didn't do a very careful job here. There's still lots of room for improvement. Since this requires testing plugins in some cases, I couldn't be bothered, so I only fixed the obvious stuff.
As usual, review the commits separately.