dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/39862?usp=email )
(
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: saip-tool: allow removing of profile elements by type ......................................................................
saip-tool: allow removing of profile elements by type
At the moment it is only possible to remove profile elements by their identification number. However, there may be cases where we want to remove all profile elements of a certain type at once (e.g. when removing all applications).
Change-Id: I92f9f9d5b4382242963f1b3ded814a0d013c4808 --- M contrib/saip-tool.py 1 file changed, 5 insertions(+), 1 deletion(-)
Approvals: fixeria: Looks good to me, approved laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/contrib/saip-tool.py b/contrib/saip-tool.py index c2115a6..64aba93 100755 --- a/contrib/saip-tool.py +++ b/contrib/saip-tool.py @@ -54,7 +54,8 @@
parser_rpe = subparsers.add_parser('remove-pe', help='Remove specified PEs from PE-Sequence') parser_rpe.add_argument('--output-file', required=True, help='Output file name') -parser_rpe.add_argument('--identification', type=int, action='append', help='Remove PEs matching specified identification') +parser_rpe.add_argument('--identification', default=[], type=int, action='append', help='Remove PEs matching specified identification') +parser_rpe.add_argument('--type', default=[], action='append', help='Remove PEs matching specified type')
parser_rn = subparsers.add_parser('remove-naa', help='Remove speciifed NAAs from PE-Sequence') parser_rn.add_argument('--output-file', required=True, help='Output file name') @@ -146,6 +147,9 @@ if identification in opts.identification: print("Removing PE %s (id=%u) from Sequence..." % (pe, identification)) continue + if pe.type in opts.type: + print("Removing PE %s (type=%s) from Sequence..." % (pe, pe.type)) + continue new_pe_list.append(pe)
pes.pe_list = new_pe_list