Change in pysim[master]: commands: add method to determine size of a non record oriented file

2020-05-17 Thread laforge
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/18209 
)

Change subject: commands: add method to determine size of a non record oriented 
file
..

commands: add method to determine size of a non record oriented file

For record oriented files we have the methods record_size() and
record_count() to determine the dimensions of a record oriented file,
however, we miss a similar function for regular binary files. Lets add a
method binary_size() to quickly determine the size of a non record
oriented file

Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
---
M pySim/commands.py
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/pySim/commands.py b/pySim/commands.py
index cc7acc6..30e995c 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -152,6 +152,10 @@
r = self.select_file(ef)
return self.__len(r) // self.__record_len(r)

+   def binary_size(self, ef):
+   r = self.select_file(ef)
+   return self.__len(r)
+
def run_gsm(self, rand):
if len(rand) != 32:
raise ValueError('Invalid rand')

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
Gerrit-Change-Number: 18209
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in pysim[master]: commands: add method to determine size of a non record oriented file

2020-05-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/18209 )

Change subject: commands: add method to determine size of a non record oriented 
file
..


Patch Set 4: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
Gerrit-Change-Number: 18209
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 17 May 2020 07:58:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: commands: add method to determine size of a non record oriented file

2020-05-12 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/18209 )

Change subject: commands: add method to determine size of a non record oriented 
file
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
Gerrit-Change-Number: 18209
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Tue, 12 May 2020 18:07:16 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: commands: add method to determine size of a non record oriented file

2020-05-11 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/18209 )


Change subject: commands: add method to determine size of a non record oriented 
file
..

commands: add method to determine size of a non record oriented file

For record oriented files we have the methods record_size() and
record_count() to determine the dimensions of a record oriented file,
however, we miss a similar function for regular binary files. Lets add a
method binary_size() to quickly determine the size of a non record
oriented file

Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
---
M pySim/commands.py
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/09/18209/1

diff --git a/pySim/commands.py b/pySim/commands.py
index cc7acc6..30e995c 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -152,6 +152,10 @@
r = self.select_file(ef)
return self.__len(r) // self.__record_len(r)

+   def binary_size(self, ef):
+   r = self.select_file(ef)
+   return self.__len(r)
+
def run_gsm(self, rand):
if len(rand) != 32:
raise ValueError('Invalid rand')

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
Gerrit-Change-Number: 18209
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange