[WIP] Deploy to multiple subreddits#1
Open
jewel-andraia wants to merge 4 commits into13steinj:masterfrom
Open
Conversation
If the `subreddit` environment variable is a comma-separated list of subreddits, eg. `pics+funny`, then deploy the stylesheet to both /r/pics and /r/funny.
| )(**data) | ||
| for subreddit in os.getenv('subreddit').split('+'): | ||
| deploy_data = {'subreddit': subreddit} | ||
| for image, exists in diff.items(): |
Owner
There was a problem hiding this comment.
Running for loops consecutively is slow cause CPython isn't a JIT compiler. Do you mind moving things around so the "subreddit" for loop occurs within the diff loop, data initially being an empty dict instead of a copied version of deploydata, and then set 'subreddit' on it within that loop?
E: grammar
Owner
There was a problem hiding this comment.
I'm no saint on this, but any updates? Or if you don't have the time, may I squash and merge?
Author
There was a problem hiding this comment.
Sure, go ahead and merge/rework it however you like.
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.
If the
subredditenvironment variable is a plus sign-separated list of subreddits, eg.pics+funny, then deploy the stylesheet and images to both /r/pics and /r/funny.