laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41734?usp=email )
Change subject: esim.saip.FsProfileElement: Add file2pe() for single file conversion ......................................................................
esim.saip.FsProfileElement: Add file2pe() for single file conversion
We've had files2pe() for re-encoding all of the files, but let's add a specific one for re-encoding only one of the files (such as commonly needed during personalization)
Change-Id: I7b7f61aae6b7df6946dadf2f78fddf92995603ec --- M pySim/esim/saip/__init__.py 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/34/41734/1
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index 1c0c715..6e8823b 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -633,8 +633,12 @@ self.pe_sequence.cur_df = pe_df self.pe_sequence.cur_df = self.pe_sequence.cur_df.add_file(file)
+ def file2pe(self, f: File): + """Update the "decoded" member for the given file with the contents from the given File.""" + self.decoded[f.pe_name] = f.to_tuples() + def files2pe(self): - """Update the "decoded" member with the contents of the "files" member.""" + """Update the "decoded" member for each file with the contents of the "files" member.""" for k, f in self.files.items(): self.decoded[k] = f.to_tuples()