Skip to content
Snippets Groups Projects
Commit b327289e authored by vlorentz's avatar vlorentz
Browse files

fix typo

parent 76cf0c20
No related branches found
Tags v0.0.166
1 merge request!65Parse Maven licenses.
......@@ -293,7 +293,6 @@ class MavenMapping(DictMapping, SingleFileMapping):
Which was translated to a dict by xmltodict and is given as `d`:
>>> from pprint import pprint
>>> d = {
... # ...
... "licenses": {
......@@ -306,6 +305,10 @@ class MavenMapping(DictMapping, SingleFileMapping):
... }
>>> MavenMapping().parse_licenses(d)
[{'@id': 'https://www.apache.org/licenses/LICENSE-2.0.txt'}]
or, if there are more than one license:
>>> from pprint import pprint
>>> d = {
... # ...
... "licenses": {
......@@ -325,8 +328,6 @@ class MavenMapping(DictMapping, SingleFileMapping):
>>> pprint(MavenMapping().parse_licenses(d))
[{'@id': 'https://www.apache.org/licenses/LICENSE-2.0.txt'},
{'@id': 'https://opensource.org/licenses/MIT'}]
or, if there are more than one license:
"""
licenses = d.get('licenses', {}).get('license', [])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment