diff --git a/platformio/package/manifest/parser.py b/platformio/package/manifest/parser.py index 66dee43c..28743e54 100644 --- a/platformio/package/manifest/parser.py +++ b/platformio/package/manifest/parser.py @@ -198,10 +198,13 @@ class BaseManifestParser(object): return (None, None) name = raw email = None - for ldel, rdel in [("<", ">"), ("(", ")")]: - if ldel in raw and rdel in raw: - name = raw[: raw.index(ldel)] - email = raw[raw.index(ldel) + 1 : raw.index(rdel)] + ldel = "<" + rdel = ">" + if ldel in raw and rdel in raw: + name = raw[: raw.index(ldel)] + email = raw[raw.index(ldel) + 1 : raw.index(rdel)] + if "(" in name: + name = name.split("(")[0] return (name.strip(), email.strip() if email else None) @staticmethod diff --git a/tests/package/test_manifest.py b/tests/package/test_manifest.py index fe5054d0..c2436328 100644 --- a/tests/package/test_manifest.py +++ b/tests/package/test_manifest.py @@ -198,7 +198,7 @@ def test_library_properties_parser(): contents = """ name=TestPackage version=1.2.3 -author=SomeAuthor +author=SomeAuthor , Another Author (nickname) sentence=This is Arduino library customField=Custom Value depends=First Library (=2.0.0), Second Library (>=1.2.0), Third @@ -218,7 +218,10 @@ ignore_empty_field= "export": { "exclude": ["extras", "docs", "tests", "test", "*.doxyfile", "*.pdf"] }, - "authors": [{"email": "info@author.com", "name": "SomeAuthor"}], + "authors": [ + {"email": "info@author.com", "name": "SomeAuthor"}, + {"name": "Another Author"}, + ], "keywords": ["uncategorized"], "customField": "Custom Value", "depends": "First Library (=2.0.0), Second Library (>=1.2.0), Third",