-
Notifications
You must be signed in to change notification settings - Fork 19
Fix incorrect copyright notice for Wikimedia images #2644
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
base: 0.5.x
Are you sure you want to change the base?
Conversation
|
@jbh1996 Thanks for your PR! As you can see, some tests are failing. You can run these locally with What's the scope of this PR? To display this copyright information on the file pages? E.g. to fix #2583 ? |
|
@jbh1996 I noticed your Betty fork was made from Betty 0.4.x. Since then, the 0.5.x branch was created and all new development happens there (with bug fixes potentially backported to 0.4.x once fixed in 0.5.x). You'll want to make sure your local development branch is kept up to date with 0.5.x, or it'll end up diverging so much your Git changes can no longer be applied (preventing a PR merge). Let me know if you need help with something 👍 |
|
Hey Bart! I just got a chance to work on this again. I made some edits and the bin/fix is giving me no errors back. Let me know if there's still changes that need to be made to the pull request. Sorry this took me a bit to get to. |
|
@jbh1996 No worries, and take your time. Thanks for addressing the feedback and fixing the test failures. Your code looks good but we're now at the point where we need to do something with this new functionality, as well as write tests for it. In order to determine exactly what else needs to be done, is it #2583 you are trying to fix? If so (please confirm in a comment), then what remains is:
|
|
Yes it is #2583 that I'm trying to fix. I'll get into those files in the next few days to try to make this work. Thanks for your patience and pointers. |
|
I've made changes to both the copyright_notice and populator file for your review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a look at the failing tests. For fastest feedback, run the tests locally on your own machine before pushing, so you can fix failures quickly without having to wait for the Github builds to complete.
| title: str | ||
| wikimedia_commons_url: str | ||
| name: str | ||
| image_copyright: Copyright | None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class is called "image" already, so we can simply call the attribute "copyright".
| url=image.image_copyright.url, | ||
| ) | ||
| if image.image_copyright | ||
| else await WikipediaContributors.new_for_app(self._ancestry.app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original issue this PR tries to fix is that we are currently telling people these images are copyright Wikipedia contributors, but that is not the case (the images do not even come from Wikipedia). If we cannot get copyright information from Wikimedia, we should therefore let the image copyright be empty.
| links=links, | ||
| copyright_notice=self._copyright_notice, | ||
| copyright_notice=( | ||
| await WikimediaCommonsCopyright.new_for_app( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These factory methods exist so that code can instantiate classes without knowing what arguments their __init__() methods require, usually because the class name is not hardcoded. In this case we know the class name, so we can instantiate it without having to call .new_for_app().
This pull request creates the copyright class in the wiki client.py and updates the get_image function to populate it. It also edits the Image class to include a copyright attribute.