Attention is currently required from: fixeria, dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/33691 )
Change subject: split pySim/legacy/{cards,utils} from pySim/{cards,utils}
......................................................................
Patch Set 5:
(2 comments)
Patchset:
PS5:
> This stuff is important for users installing pySim as a local or system-wide package. […]
Done
File pySim/cards.py:
https://gerrit.osmocom.org/c/pysim/+/33691/comment/98bd1f15_02708cf9
PS5, Line 85: EF.DIR
> yes, the comment should be removed. the code is right.
Done
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33691
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia8cf831929730c48f90679a83d69049475cc5077
Gerrit-Change-Number: 33691
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Jul 2023 19:37:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, dexter.
Hello Jenkins Builder, fixeria, dexter,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/33691
to look at the new patch set (#6).
Change subject: split pySim/legacy/{cards,utils} from pySim/{cards,utils}
......................................................................
split pySim/legacy/{cards,utils} from pySim/{cards,utils}
There are some functions / classes which are only needed by the legacy
tools pySim-{read,prog}, bypassing our modern per-file transcoder
classes. Let's move this code to the pySim/legacy sub-directory,
rendering pySim.legacy.* module names.
The long-term goal is to get rid of those and have all code use the
modern pySim/filesystem classes for reading/decoding/encoding/writing
any kind of data on cards.
Change-Id: Ia8cf831929730c48f90679a83d69049475cc5077
---
M pySim-prog.py
M pySim-read.py
M pySim-shell.py
M pySim-trace.py
M pySim/cards.py
A pySim/legacy/__init__.py
A pySim/legacy/cards.py
A pySim/legacy/utils.py
M pySim/utils.py
M setup.py
M tests/test_utils.py
11 files changed, 1,942 insertions(+), 1,926 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/91/33691/6
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33691
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia8cf831929730c48f90679a83d69049475cc5077
Gerrit-Change-Number: 33691
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: fixeria, dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/33690 )
Change subject: pySim/cards: Split legacy classes away from core SIM + UICC
......................................................................
Patch Set 4:
(2 comments)
File pySim/cards.py:
https://gerrit.osmocom.org/c/pysim/+/33690/comment/67ce13fb_86eba0d8
PS4, Line 41: self._aids = []
> thanks, this should be in the constructor.
Done
https://gerrit.osmocom.org/c/pysim/+/33690/comment/9f4d2de6_152df544
PS4, Line 319: SimCard
> `UiccCardBase` is a [grand]child of `SimCard`, do we really need `SimCard` here?
indeed. In our code model we don't need SimCard here, but from a ETSI/3GPP point of view a [typical] Usim is UICC + SIM. The reason we have the "wrong" relationship of UiccCardBase inheriting from SimCardBase instead of CardBase is that the read_{binary,record} methods are identical.
Maye I should simply copy+paste those 10 lines of code and maeke UiccCardBase inherit from CardBase rather than SimCard?
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33690
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id36140675def5fc44eedce81fc7b09e0adc527e1
Gerrit-Change-Number: 33690
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Jul 2023 19:36:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria, dexter.
Hello Jenkins Builder, fixeria, dexter,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/33690
to look at the new patch set (#5).
Change subject: pySim/cards: Split legacy classes away from core SIM + UICC
......................................................................
pySim/cards: Split legacy classes away from core SIM + UICC
This introduces an internal split between
* the code that is shared between pySim-shell and legacy tools, which is
now in the new class hierarchy {Card,SimCard,UiccCard}Base
* the code that is only used by legacy tools,
which is using the old class names inherited from the *Base above
All users still go through the legacy {Sim,Usim,Isim}Card classes, they
will be adjusted in subsequent patches.
Change-Id: Id36140675def5fc44eedce81fc7b09e0adc527e1
---
M pySim/cards.py
M pysim-testdata/fakemagicsim.ok
M pysim-testdata/sysmosim-gr1.ok
3 files changed, 99 insertions(+), 70 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/90/33690/5
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33690
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id36140675def5fc44eedce81fc7b09e0adc527e1
Gerrit-Change-Number: 33690
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33689 )
Change subject: filesystem: Support selecting MF from MF
......................................................................
filesystem: Support selecting MF from MF
This was currently not handled in build_select_path_to(), resulting in
weird exceptions like 'Cannot determine path from MF(3f00) to MF(3f00)'
Change-Id: I41b9f047ee5dc6b91b487f370f011af994aaca04
---
M pySim/filesystem.py
1 file changed, 15 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 04e849b..22ff60d 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -149,6 +149,9 @@
def build_select_path_to(self, target: 'CardFile') -> Optional[List['CardFile']]:
"""Build the relative sequence of files we need to traverse to get from us to 'target'."""
+ # special-case handling for selecting MF while we MF is selected
+ if target == target.get_mf():
+ return [target]
cur_fqpath = self.fully_qualified_path_fobj()
target_fqpath = target.fully_qualified_path_fobj()
inter_path = []
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33689
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I41b9f047ee5dc6b91b487f370f011af994aaca04
Gerrit-Change-Number: 33689
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/33691 )
Change subject: split pySim/legacy/{cards,utils} from pySim/{cards,utils}
......................................................................
Patch Set 5:
(1 comment)
Patchset:
PS5:
> I had no idea that __init__.py was mandatory even if it doesn't actually contain any code. […]
This stuff is important for users installing pySim as a local or system-wide package. It works without these `__init__.py` files if you invoke `pySim-*.py` scripts from their source code directory, but not when it's installed as a package.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33691
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia8cf831929730c48f90679a83d69049475cc5077
Gerrit-Change-Number: 33691
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Jul 2023 18:52:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/33693 )
Change subject: create pySim.legacy.ts_51_011.py and move legacy code there
......................................................................
Patch Set 3:
(1 comment)
File pySim/legacy/ts_51_011.py:
https://gerrit.osmocom.org/c/pysim/+/33693/comment/7f7b3e9f_ad5794ba
PS3, Line 7: """ Various constants from 3GPP TS 51.011 used by *legacy* code only.
> I don't have a strong opinion here, but the fact that these definitions are used by legacy code only […]
the point is that nobody should use those incomplete data types here anymore. They do not reflect the hierarchical nature of the filesystem, but put all kinds of DFs in a flat dict. Likewise, they are certainly ages behind 3GPP specs.
New code should make use of the pySim.filesystem class hierarchy to navigate the filesystem, select files, etc.
It's never a good idea to have information duplicated in several locations in one code base.
I would actually love to delete all this code, but there are still tons of users of the equally crufty pySim-prog. Eventually I might spend time re-implementing a saner version of pySim-prog not using any of the definitions here, but time/availability is of course a constraint.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33693
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I20ceea3fdb02ee70d8c8889c078b2e5a0f17c83b
Gerrit-Change-Number: 33693
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Jul 2023 18:50:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria, dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/33690 )
Change subject: pySim/cards: Split legacy classes away from core SIM + UICC
......................................................................
Patch Set 4:
(2 comments)
File pySim/cards.py:
https://gerrit.osmocom.org/c/pysim/+/33690/comment/72190f20_2f433eab
PS4, Line 31: base class
> Do we want to make it an abstract base class (`@abc. […]
possibly, I'm not entirely sure which way this will develop. In general, the entire 'CardBase + subclasses' here in the non-legacy module has very little functionality, the real work is in SmartCardCommands (which is also ugly as it mixes commands for SIM + UICC in one class, ...).
https://gerrit.osmocom.org/c/pysim/+/33690/comment/9d1f4fc8_c0be856c
PS4, Line 41: self._aids = []
> unreachable code
thanks, this should be in the constructor.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33690
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id36140675def5fc44eedce81fc7b09e0adc527e1
Gerrit-Change-Number: 33690
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Jul 2023 18:47:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria, dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/33691 )
Change subject: split pySim/legacy/{cards,utils} from pySim/{cards,utils}
......................................................................
Patch Set 5:
(1 comment)
Patchset:
PS5:
> * You're missing to add `__init__.py` to new submodules. […]
I had no idea that __init__.py was mandatory even if it doesn't actually contain any code. I have close to zero knowlege about setup.py and/or other python installers. Thanks.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33691
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia8cf831929730c48f90679a83d69049475cc5077
Gerrit-Change-Number: 33691
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Jul 2023 18:45:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment