支持多位合作者

This commit is contained in:
xtaodada 2023-02-03 18:05:44 +08:00
parent 568a0eb9ef
commit 23aedb3a3e
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 5 additions and 4 deletions

View File

@ -48,7 +48,8 @@ def format_text(text: str) -> str:
def gen_tags(data: Module) -> str: def gen_tags(data: Module) -> str:
text = f"#{format_text(data.description.split()[0])} " text = f"#{format_text(data.description.split()[0])} "
if data.collaborators: if data.collaborators:
text += f"#{format_text(data.collaborators[0])} " for i in data.collaborators:
text += f"#{format_text(i)} "
return text return text

View File

@ -41,10 +41,10 @@ class Module:
self.createdAt: str = strf_time(data["createdAt"]) self.createdAt: str = strf_time(data["createdAt"])
text = [] text = []
for i in data["collaborators"]: for i in data["collaborators"]:
if i["name"]: if i.get("name"):
text.append(i["name"]) text.append(i["name"].replace(" ", "_").replace(".", "_").replace("-", "_"))
else: else:
text.append(i["login"]) text.append(i["login"].replace(" ", "_").replace(".", "_").replace("-", "_"))
self.collaborators: List[str] = text self.collaborators: List[str] = text
self.latestRelease: str = data.get("latestRelease", "") self.latestRelease: str = data.get("latestRelease", "")
releases = [] releases = []