-
Notifications
You must be signed in to change notification settings - Fork 9
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
Overhaul priviblur-extractor #98
Merged
Merged
Conversation
This file contains 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
use None for default val of url params Remove unreachable logic in _get_json Remove unused variable
Converts .process into a classmethod that initializes and calls the .parse method of the corresponding parser when a match is found
Removes the usage of the ELEMENT_PARSERS constant
Merged directly into logic of post parser's parse method
BlogThemeParser can simply be a method of BlogInfoParser
BlogParser -> BlogTimelineParser BlogInfoParser -> BlogParser This new name is more accurate as to the actual parsed results of the two parsers. The old BlogInfoParser parses the actual blog that contains the name, header, etc; while the BlogParser parses a simple object that stores the blog info (which calls BlogInfoParser), a list of posts, and a cursor.
A blog's theme attribute should always exist
More efficient to directly initialize and call .parse() instead rather than relying on a parameter that essentially does the same result.
There is no need for the complicated error handling that we previously had in the logic for parsing trail posts. Tumblr's API is in general quite stable and there shouldn't be any missing fields.
Blog model is used to represent the contents of a blog and not the blog itself. As such it has been renamed.
Any changes to `fields[blog]` could potentially break parsing. In addition the attribute should also match real Tumblr API requests as much as possible
True bool is converted to "True" and not "true"
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 cleans up the
priviblur-extractor
module significantly.The internal logic remains mostly unchanged but file structure and method order was altered significantly to make it easier to maintain and understand.
I think I'd like to eventually separate this into a separate installable python package as so other projects can use it, and so that we can have (well add in this case) tests specific to the extractor in a more organized way.