Skip to content

Wikipedia url#56

Open
zachjesus wants to merge 11 commits into
masterfrom
wikipedia-url
Open

Wikipedia url#56
zachjesus wants to merge 11 commits into
masterfrom
wikipedia-url

Conversation

@zachjesus

Copy link
Copy Markdown
Contributor
  • Added two functions to DublinCoreMapping.py named get_wikipedia_urls() and add_wikipedia_url. The former returns a list of wikipedia urls for a given author, and the latter adds a wikipedia url to a books attributes in the db.

…ikipedia_urls. There is still a function to add urls and there is now one to remove them as well. Add url doesnt need a prefix, it will auto put one, but a custom one may be included and defualt will not be added (if wanted forever whatever reason). The remove function acccepts a inputs with prefix+url or just url.
@eshellman

Copy link
Copy Markdown
Contributor

You've probably heard that there are only two really difficult problems in programming: cache invalidation, naming things, and off-by-one errors.

Will look through this tomorrow, but in https://github.com/gutenbergtools/pglaf-workflow which is the code that Robert has adapted to carry wikipedia urls, the name of the field is just WIKIPEDIA_URL. So in this code, we don't want to introduce new names. Adding "book_" to "wikipedia_url" seems redundant. The DublinCore object is already about a book. If we introduce other types of wikipedia url it would likely modify something else, like author or subject.

@zachjesus

Copy link
Copy Markdown
Contributor Author

Yeah I added it because we have authror wikipedia urls, a bit semantic but I wanted to distinguish so no one passed author wikipedia URLS via the dispatcher to the section thats for books, I can easily change it you want.

@eshellman

Copy link
Copy Markdown
Contributor

yes, change it

@eshellman eshellman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just reviewed changes in DublinCore

Comment thread libgutenberg/DublinCore.py
Comment thread libgutenberg/DublinCore.py Outdated
Comment thread libgutenberg/DublinCore.py
Comment thread libgutenberg/DublinCore.py Outdated
Comment thread libgutenberg/DublinCore.py Outdated
Comment thread libgutenberg/DublinCore.py Outdated
@zachjesus

Copy link
Copy Markdown
Contributor Author

Thanks Ill check them out and make the edits.

@eshellman eshellman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can talk at 2

Comment thread libgutenberg/Models.py
Comment thread libgutenberg/Models.py
Comment thread libgutenberg/DublinCoreMapping.py Outdated
Comment thread libgutenberg/DublinCoreMapping.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants