Skip to content
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

Improve licenses detection in harvesting #1203

Merged
merged 2 commits into from Oct 9, 2017
Merged

Improve licenses detection in harvesting #1203

merged 2 commits into from Oct 9, 2017

Conversation

noirbizarre
Copy link
Contributor

This PRs improve the Licence.guess() helper by allowing a list of string and a default fallback license.
It also expose the default license as License.default()
All harvesters now use the same algorithm.

@noirbizarre noirbizarre added this to the 1.2.0 milestone Oct 9, 2017
@noirbizarre noirbizarre requested a review from a team October 9, 2017 09:32
def guess(cls, text):
def guess(cls, *strings, **kwargs):
'''
Try to guess a license from a list of strings.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe document the default kwarg?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or declare it explicitly in the method signature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not possible to declare explicitely a keyword argument with variable arguments in Python 2 (already tried :/).
I'll add it to the documentation.

@noirbizarre noirbizarre merged commit 6d7529f into opendatateam:master Oct 9, 2017
@noirbizarre noirbizarre deleted the harvest-improve-licenses-detection branch October 9, 2017 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants