dexter has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/39862?usp=email )
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(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/39862/1
diff --git a/contrib/saip-tool.py b/contrib/saip-tool.py
index 05b828b..1ffc0e2 100755
--- a/contrib/saip-tool.py
+++ b/contrib/saip-tool.py
@@ -53,7 +53,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')
@@ -180,6 +181,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
--
To view, visit
https://gerrit.osmocom.org/c/pysim/+/39862?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I92f9f9d5b4382242963f1b3ded814a0d013c4808
Gerrit-Change-Number: 39862
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>