swh.lister.gitlab: Improve headers extraction
This commit is contained in:
parent
847a8d341a
commit
13bb7aca58
4 changed files with 69 additions and 3 deletions
14
swh/lister/utils.py
Normal file
14
swh/lister/utils.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Copyright (C) 2018 the Software Heritage developers
|
||||
# License: GNU General Public License version 3, or any later version
|
||||
# See top-level LICENSE file for more information
|
||||
|
||||
|
||||
def get(d, keys):
|
||||
"""Given a dict, lookup in order for keys with values not None.
|
||||
|
||||
"""
|
||||
for key in keys:
|
||||
v = d.get(key)
|
||||
if v is not None:
|
||||
return v
|
||||
return None
|
Loading…
Add table
Add a link
Reference in a new issue