mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
build(codemeta): Support [ORCID]
syntax
This commit is contained in:
parent
b707a8b45e
commit
69220a2e49
|
@ -37,9 +37,12 @@ class CodeMetaManipulator(object):
|
||||||
if entry is None:
|
if entry is None:
|
||||||
entry = OrderedDict()
|
entry = OrderedDict()
|
||||||
entry['@type'] = 'Person'
|
entry['@type'] = 'Person'
|
||||||
for field in ('givenName', 'familyName', 'email'):
|
for field in ('givenName', 'familyName', 'email', 'orcid'):
|
||||||
val = matchdict.get(field, None)
|
val = matchdict.get(field, None)
|
||||||
if val is not None:
|
if val is not None:
|
||||||
|
if field == 'orcid':
|
||||||
|
entry['@id'] = val
|
||||||
|
else:
|
||||||
entry[field] = val
|
entry[field] = val
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
|
@ -47,7 +50,8 @@ class CodeMetaManipulator(object):
|
||||||
fp = open(filename, 'r', encoding='utf8')
|
fp = open(filename, 'r', encoding='utf8')
|
||||||
findregex = re.compile(r'^(?P<familyName>[-\w\s]*[-\w]),\s*'
|
findregex = re.compile(r'^(?P<familyName>[-\w\s]*[-\w]),\s*'
|
||||||
r'(?P<givenName>[-\w\s]*[-\w])\s*'
|
r'(?P<givenName>[-\w\s]*[-\w])\s*'
|
||||||
r'(?:<(?P<email>\S+@\S+)>)?$')
|
r'(?:<(?P<email>\S+@\S+)>)?\s*'
|
||||||
|
r'(\[(?P<orcid>\S+)\])?$')
|
||||||
person_list = self.data.setdefault(cm_field_name, [])
|
person_list = self.data.setdefault(cm_field_name, [])
|
||||||
for line in fp:
|
for line in fp:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user