lynxis lazus has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/41687?usp=email )
Change subject: saip: calculate the number of records for LF and CY
......................................................................
saip: calculate the number of records for LF and CY
Some templates (e.g. for 5GS) define files which aren't completely defined.
5GS OPL5G: doesn't have a file size defined in the template,
but a record size.
Change-Id: I5ec1757d6852eb24d3662ec1c3fc88365e90a616
---
M pySim/esim/saip/__init__.py
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/87/41687/1
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index 6ec8b23..978a52a 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -144,6 +144,9 @@
def file_size(self) -> Optional[int]:
"""Return the size of the file in bytes."""
if self.file_type in ['LF', 'CY']:
+ if self._file_size and self.nb_rec is None and self.rec_len:
+ self.nb_rec = self._file_size // self.rec_len
+
return self.nb_rec * self.rec_len
elif self.file_type in ['TR', 'BT']:
return self._file_size
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41687?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: I5ec1757d6852eb24d3662ec1c3fc88365e90a616
Gerrit-Change-Number: 41687
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <[email protected]>