Apply polish to project#6
Open
ngie-eign wants to merge 8 commits into
Open
Conversation
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
This change adds `Forbidden` to a number of `canvasapi` calls so the script doesn't fall flat on its face with newer versions of the API. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
The previous `Pipfile` was stale and didn't have any real customizations that differed from the vanilla `pipenv install`'ed version. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
- Mention `pipx` usage. - Suggest `pipenv run` usage. - Remove explicit dependencies. - This is articulated in [pyproject.toml](/pyproject.toml). Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
### Logging changes
This change converts multiple f-string non-lazy logging statements to
lazy logging statements for performance and for functional reasons (to
avoid possible crashes). Moreover, `exc_info=True` is used with some
calls to dump out exception stacks when necessary instead of getting a
partial answer with `str(e)`. Finally, this change converts multiple
logging calls from direct formatting anti-patterns, e.g.,
`logging.error(str(foo))` to safer/more performant format string
equivalents, e.g., `logging.error("%s", foo)`.
Finally, while here convert a URL "MRU cache" from a `list` to a
`collections.Counter` object. Although the number of URLs in a class is
likely small, there can be a slight performance benefit of using
`dict.__contains__` instead of `list.__contains__`.
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
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.
This change addresses a number of low-hanging fruit changes to make the project easier to maintain/use with alternate tools like
pipx, etc.It also applies some basic niceties suggested via
blackandruff format.Sidenote: this version doesn't successfully scrape all of the courses I'm currently enrolled in, but it's a move in the right direction. It needs to do more "deep inspection" in the course pages to gather all of the available media/files instead of assuming files/, media/, etc, exists and is accessible.