|
23 | 23 | parameters = {}
|
24 | 24 |
|
25 | 25 | if args.keyword:
|
26 |
| - parameters.update({"q": f"name:{args.keyword}"}) |
| 26 | + parameters.update({"q": f"name:{args.keyword}"}) |
27 | 27 |
|
28 | 28 | if args.limit:
|
29 |
| - parameters.update({"limit": args.limit}) |
| 29 | + parameters.update({"limit": args.limit}) |
30 | 30 |
|
31 | 31 | logging.debug(f"Retrieving licenses using parameters={parameters}")
|
32 | 32 | licenses = hub.get_licenses(parameters=parameters).get('items', [])
|
33 | 33 |
|
34 | 34 | logging.debug(f"Found {len(licenses)} licenses")
|
35 | 35 |
|
36 | 36 | for license in licenses:
|
37 |
| - logging.debug(f"Retrieving license text, terms, and obligations info for license \"{license['name']}\"") |
38 |
| - text_url = hub.get_link(license, "text") |
39 |
| - license['text'] = hub.execute_get(text_url).json().get('text') |
| 37 | + logging.debug(f"Retrieving license text, terms, and obligations info for license \"{license['name']}\"") |
| 38 | + text_url = hub.get_link(license, "text") |
| 39 | + license['text'] = hub.execute_get(text_url).json().get('text') |
40 | 40 |
|
41 |
| - terms_url = hub.get_link(license, 'license-terms') |
42 |
| - license['terms'] = hub.execute_get(terms_url).json().get('items', []) |
| 41 | + terms_url = hub.get_link(license, 'license-terms') |
| 42 | + license['terms'] = hub.execute_get(terms_url).json().get('items', []) |
43 | 43 |
|
44 |
| - obligations_url = hub.get_link(license, 'license-obligations') |
45 |
| - license['obligations'] = hub.execute_get(obligations_url).json().get('items', []) |
| 44 | + obligations_url = hub.get_link(license, 'license-obligations') |
| 45 | + license['obligations'] = hub.execute_get(obligations_url).json().get('items', []) |
46 | 46 |
|
47 | 47 | print(json.dumps(licenses))
|
0 commit comments