Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame^] | 1 | # upstream-status pyparsing definition |
| 2 | # |
| 3 | # Copyright (C) 2016 Intel Corporation |
| 4 | # |
| 5 | # SPDX-License-Identifier: GPL-2.0 |
| 6 | |
| 7 | |
| 8 | import common |
| 9 | import pyparsing |
| 10 | |
| 11 | upstream_status_literal_valid_status = ["Pending", "Backport", "Denied", "Inappropriate", "Submitted"] |
| 12 | upstream_status_nonliteral_valid_status = ["Pending", "Backport", "Denied", "Inappropriate [reason]", "Submitted [where]"] |
| 13 | |
| 14 | upstream_status_valid_status = pyparsing.Or( |
| 15 | [pyparsing.Literal(status) for status in upstream_status_literal_valid_status] |
| 16 | ) |
| 17 | |
| 18 | upstream_status_mark = pyparsing.Literal("Upstream-Status") |
| 19 | inappropriate_status_mark = common.inappropriate |
| 20 | submitted_status_mark = common.submitted |
| 21 | |
| 22 | upstream_status = common.start + upstream_status_mark + common.colon + upstream_status_valid_status |
| 23 | upstream_status_inappropriate_info = common.start + upstream_status_mark + common.colon + common.inappropriateinfo |
| 24 | upstream_status_submitted_info = common.start + upstream_status_mark + common.colon + common.submittedinfo |