Add support for multiple audiences#36
Open
jstevensfit wants to merge 2 commits intowichert:masterfrom
Open
Conversation
Contributor
jstevensfit
commented
Mar 12, 2020
- Add support for a comma separated list of audiences
- Existing functionality for a single audience is supported
- Provided tests for new functionality
wichert
requested changes
Mar 25, 2020
Owner
wichert
left a comment
There was a problem hiding this comment.
This change changes the API by turning audience into a list. Can you add a clear note to the changelog and readme to warn about that?
Comment on lines
+97
to
+107
| def _aud_string_to_list(self, audience): | ||
| """ | ||
| Splits the audience variable into a | ||
| list to handle multiple audiences. | ||
| :param audience: Comma separated list of audiences | ||
| :return: List of one or more audiences | ||
| """ | ||
| if audience is None: | ||
| return None | ||
| else: | ||
| return audience.split(',') |
Owner
There was a problem hiding this comment.
Can you move that method out of the class into a separate function? Since it doesn't need to use anything from self there is no need for it to be a method.
I would also suggest splitting on something like re.split(r'\s*,\s*, audience)` to make this a bit friendlier.
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
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.