Merged
Conversation
This lets us run a command like: $ python manage.py councillors -t example -v Which is useful when trying out commands that run multiple scrapers.
This pulls what was in the councillor command into the PerCouncilCommandBase class. This is so that it can be reused. Along the way I've: - dropped reporting on skipped/missing/etc councils with the progress bars - these can come back, but weren't working as intended. - Made the command runner explicitly call `execute` rather than it appear in the __init__ method. - Added a 'pretty' flag to manage what output is shown.
Member
|
Should we close this PR, as I left comments on the same code in #13? |
Contributor
Author
I think I'd like to get this merged seperatly - if only to keep #13 smaller. I used it in #13 as much to check/demonstrate the ergonomics as anything else. Any changes that are needed in #13 then won't be as drastic. I'd also like to use the changes in #11. } |
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.
I don't think this is 'done', but it is easier to work with. In particular I don't think I've got the control with the 'pretty' flag quite right. However I'm hopeful it can be iterated from here.
I think we can use Rich 'everywhere' if I've understood the documentation correctly. I think a way to manage this is to just output 'logging' from the Scrapers, and have nice cli reporting handled in the Commands. This way when the
scraper_worker_handlerruns the scraper directly (rather than through the Command) we get the logging with out the boxes/columns/progress bars.I've merged this into #13 in order to see how it plays with the handlers and the whole sam deploy.