From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 37BAA7803CC for ; Fri, 10 Nov 2023 19:31:23 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=0YLKXYHy/rBxJbo3JDekiWMa6rclKeCsIMxkqCL3cBY=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1699644681; v=1; b=dRkWesNAIn5kCgtLaWzm8BnmtN625CFSbPK9agujeNaRO/DQV5dYQrhuHhV0TRaCigEjlRDw gUjlK1eeB0jU7uPY7E9wMTZu6aAHjJdPN9AznqV++SQVG+2lFTYiWSUrxNvkxLRSO6Kwzmk/OUg GbQRGQkvpTMEQSqUCr+Ll4Go= X-Received: by 127.0.0.2 with SMTP id kNTQYY7687511xBUFF9bzpjD; Fri, 10 Nov 2023 11:31:21 -0800 X-Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web11.37342.1699644681248061624 for ; Fri, 10 Nov 2023 11:31:21 -0800 X-Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAJFF6k024547; Fri, 10 Nov 2023 19:31:11 GMT X-Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3u9tgy02se-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 19:31:11 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AAJVAVR008983 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 19:31:10 GMT X-Received: from qc-i7.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Fri, 10 Nov 2023 11:31:08 -0800 From: "Leif Lindholm" To: CC: Michael D Kinney , Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen Subject: [edk2-devel] [PATCH v3 3/5] BaseTools/Scripts/GetMaintainer: refactor internal returns as dicts Date: Fri, 10 Nov 2023 19:30:51 +0000 Message-ID: <20231110193053.673595-4-quic_llindhol@quicinc.com> In-Reply-To: <20231110193053.673595-1-quic_llindhol@quicinc.com> References: <20231110193053.673595-1-quic_llindhol@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: hkonbljCClqqczWQ3Y343UclamVXmSfH X-Proofpoint-ORIG-GUID: hkonbljCClqqczWQ3Y343UclamVXmSfH Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Q8lU6zLuSToylyaPJtmhtLw5x7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=dRkWesNA; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io To clean up interfaces, change the lookup functions to return dictionaries rather than multiple values. Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Cc: Michael D Kinney Signed-off-by: Leif Lindholm --- BaseTools/Scripts/GetMaintainer.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/BaseTools/Scripts/GetMaintainer.py b/BaseTools/Scripts/GetMaintainer.py index cdcdff750635..cb3aadbbefb1 100644 --- a/BaseTools/Scripts/GetMaintainer.py +++ b/BaseTools/Scripts/GetMaintainer.py @@ -96,7 +96,7 @@ def get_section_maintainers(path, section): else: lists += [address] - return maintainers, lists + return {'maintainers': maintainers, 'lists': lists} def get_maintainers(path, sections, level=0): """For 'path', iterates over all sections, returning maintainers @@ -104,22 +104,24 @@ def get_maintainers(path, sections, level=0): maintainers = [] lists = [] for section in sections: - tmp_maint, tmp_lists = get_section_maintainers(path, section) - maintainers += tmp_maint - lists += tmp_lists + recipients = get_section_maintainers(path, section) + maintainers += recipients['maintainers'] + lists += recipients['lists'] if not maintainers: # If no match found, look for match for (nonexistent) file # REPO.working_dir/ print('"%s": no maintainers found, looking for default' % path) if level == 0: - maintainers = get_maintainers('', sections, level=level + 1) + recipients = get_maintainers('', sections, level=level + 1) + maintainers += recipients['maintainers'] + lists += recipients['lists'] else: print("No maintainers set for project.") if not maintainers: return None - return maintainers + lists + return {'maintainers': maintainers, 'lists': lists} def parse_maintainers_line(line): """Parse one line of Maintainers.txt, returning any match group and its key.""" @@ -184,9 +186,8 @@ if __name__ == '__main__': for file in FILES: print(file) - addresslist = get_maintainers(file, SECTIONS) - if addresslist: - ADDRESSES += addresslist + recipients = get_maintainers(file, SECTIONS) + ADDRESSES += recipients['maintainers'] + recipients['lists'] for address in list(OrderedDict.fromkeys(ADDRESSES)): if '<' in address and '>' in address: -- 2.39.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111066): https://edk2.groups.io/g/devel/message/111066 Mute This Topic: https://groups.io/mt/102513771/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-