Change in pysim[master]: Py2 -> Py3: do not inherit classes from object

2022-07-07 Thread fixeria
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/23633 
)

Change subject: Py2 -> Py3: do not inherit classes from object
..

Py2 -> Py3: do not inherit classes from object

https://stackoverflow.com/questions/4015417/why-do-python-classes-inherit-object/45062077

Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
---
M pySim/cards.py
M pySim/commands.py
M pySim/filesystem.py
M pySim/profile.py
M pySim/transport/calypso.py
5 files changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Jenkins Builder: Verified
  dexter: Looks good to me, approved



diff --git a/pySim/cards.py b/pySim/cards.py
index 18e4ef3..55965d7 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -52,7 +52,7 @@
 return res
 

-class SimCard(object):
+class SimCard:

 name = 'SIM'

diff --git a/pySim/commands.py b/pySim/commands.py
index 7b50677..fa0458a 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -27,7 +27,7 @@
 from pySim.exceptions import SwMatchError


-class SimCardCommands(object):
+class SimCardCommands:
 def __init__(self, transport):
 self._tp = transport
 self.cla_byte = "a0"
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 7c5d49a..37c668d 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -49,7 +49,7 @@
 # tuple: logical-and of the listed services requires this file
 CardFileService = Union[int, List[int], Tuple[int, ...]]

-class CardFile(object):
+class CardFile:
 """Base class for all objects in the smart card filesystem.
 Serve as a common ancestor to all other file types; rarely used directly.
 """
@@ -1230,7 +1230,7 @@
 self.shell_commands = [self.ShellCommands()]


-class RuntimeState(object):
+class RuntimeState:
 """Represent the runtime state of a session with a card."""

 def __init__(self, card, profile: 'CardProfile'):
@@ -1648,7 +1648,7 @@
 cmd_app.unregister_command_set(c)


-class FileData(object):
+class FileData:
 """Represent the runtime, on-card data."""

 def __init__(self, fdesc):
@@ -1676,7 +1676,7 @@
 return None


-class CardApplication(object):
+class CardApplication:
 """A card application is represented by an ADF (with contained hierarchy) 
and optionally
some SW definitions."""

diff --git a/pySim/profile.py b/pySim/profile.py
index d5df083..c535bac 100644
--- a/pySim/profile.py
+++ b/pySim/profile.py
@@ -62,7 +62,7 @@
 return _mf_select_test(scc, "a0", "")


-class CardProfile(object):
+class CardProfile:
 """A Card Profile describes a card, it's filesystem hierarchy, an 
[initial] list of
 applications as well as profile-specific SW and shell commands.  Every 
card has
 one card profile, but there may be multiple applications within that 
profile."""
diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py
index 15c9e5f..e1326ac 100644
--- a/pySim/transport/calypso.py
+++ b/pySim/transport/calypso.py
@@ -26,7 +26,7 @@
 from pySim.utils import h2b, b2h


-class L1CTLMessage(object):
+class L1CTLMessage:

 # Every (encoded) L1CTL message has the following structure:
 #  - msg_length (2 bytes, net order)

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
Gerrit-Change-Number: 23633
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-CC: laforge 
Gerrit-MessageType: merged


Change in pysim[master]: Py2 -> Py3: do not inherit classes from object

2022-07-07 Thread dexter
Attention is currently required from: fixeria.
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/23633 )

Change subject: Py2 -> Py3: do not inherit classes from object
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
Gerrit-Change-Number: 23633
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-CC: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 07 Jul 2022 09:28:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: Py2 -> Py3: do not inherit classes from object

2022-07-06 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/23633 )

Change subject: Py2 -> Py3: do not inherit classes from object
..


Patch Set 3:

This change is ready for review.


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
Gerrit-Change-Number: 23633
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Comment-Date: Wed, 06 Jul 2022 20:07:55 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in pysim[master]: Py2 -> Py3: do not inherit classes from object

2021-04-06 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/23633 )

Change subject: Py2 -> Py3: do not inherit classes from object
..


Patch Set 2:

> Patch Set 2:
>
> thanks, but I fail in which way inheriting 'object' hurts us in any way?
>
> Adding this patch to a project with very active development activity right 
> now (by phillip, myself and several external contributors right now) will 
> create merge conflicts for now good reaosn.
>
> Sorry :/

This patch is purely cosmetic and was submitted to test the build setup 
(OS#4383), so I am fine with keeping it WIP or not merging at all.


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
Gerrit-Change-Number: 23633
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Comment-Date: Tue, 06 Apr 2021 20:10:35 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in pysim[master]: Py2 -> Py3: do not inherit classes from object

2021-04-06 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/23633 )

Change subject: Py2 -> Py3: do not inherit classes from object
..


Patch Set 2:

thanks, but I fail in which way inheriting 'object' hurts us in any way?

Adding this patch to a project with very active development activity right now 
(by phillip, myself and several external contributors right now) will create 
merge conflicts for now good reaosn.

Sorry :/


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
Gerrit-Change-Number: 23633
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Comment-Date: Tue, 06 Apr 2021 19:32:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in pysim[master]: Py2 -> Py3: do not inherit classes from object

2021-04-06 Thread fixeria
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/pysim/+/23633

to look at the new patch set (#2).

Change subject: Py2 -> Py3: do not inherit classes from object
..

Py2 -> Py3: do not inherit classes from object

https://stackoverflow.com/questions/4015417/why-do-python-classes-inherit-object/45062077

Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
---
A pySim/card_data.py
M pySim/card_key_provider.py
M pySim/cards.py
M pySim/commands.py
M pySim/filesystem.py
M pySim/transport/__init__.py
M pySim/transport/calypso.py
7 files changed, 123 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/23633/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/23633
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
Gerrit-Change-Number: 23633
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in pysim[master]: Py2 -> Py3: do not inherit classes from object

2021-04-05 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/23633 )


Change subject: Py2 -> Py3: do not inherit classes from object
..

Py2 -> Py3: do not inherit classes from object

https://stackoverflow.com/questions/4015417/why-do-python-classes-inherit-object/45062077

Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
---
M pySim/card_data.py
M pySim/cards.py
M pySim/commands.py
M pySim/filesystem.py
M pySim/transport/__init__.py
M pySim/transport/calypso.py
6 files changed, 10 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/23633/1

diff --git a/pySim/card_data.py b/pySim/card_data.py
index ebc63a6..6c162e8 100644
--- a/pySim/card_data.py
+++ b/pySim/card_data.py
@@ -24,7 +24,7 @@

 card_data_provider = []
 
-class CardData(object):
+class CardData:

VALID_FIELD_NAMES = ['ICCID', 'ADM1', 'IMSI', 'PIN1', 'PIN2', 'PUK1', 
'PUK2']

diff --git a/pySim/cards.py b/pySim/cards.py
index 5eb2884..a9ad7ff 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -29,7 +29,7 @@
 from smartcard.util import toBytes
 from pytlv.TLV import *

-class Card(object):
+class Card:

def __init__(self, scc):
self._scc = scc
diff --git a/pySim/commands.py b/pySim/commands.py
index 7919099..5f60280 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -24,7 +24,7 @@
 from pySim.utils import rpad, b2h, sw_match
 from pySim.exceptions import SwMatchError

-class SimCardCommands(object):
+class SimCardCommands:
def __init__(self, transport):
self._tp = transport
self._cla_byte = "a0"
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 3eea2f4..8324ab1 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -36,7 +36,7 @@
 from pySim.utils import sw_match, h2b, b2h, is_hex
 from pySim.exceptions import *

-class CardFile(object):
+class CardFile:
 """Base class for all objects in the smart card filesystem.
 Serve as a common ancestor to all other file types; rarely used directly.
 """
@@ -799,7 +799,7 @@



-class RuntimeState(object):
+class RuntimeState:
 """Represent the runtime state of a session with a card."""
 def __init__(self, card, profile:'CardProfile'):
 """
@@ -1050,7 +1050,7 @@



-class FileData(object):
+class FileData:
 """Represent the runtime, on-card data."""
 def __init__(self, fdesc):
 self.desc = fdesc
@@ -1076,7 +1076,7 @@
 return (class_str, descr)
 return None

-class CardApplication(object):
+class CardApplication:
 """A card application is represented by an ADF (with contained hierarchy) 
and optionally
some SW definitions."""
 def __init__(self, name, adf:Optional[CardADF]=None, aid:str=None, 
sw:dict=None):
@@ -1109,7 +1109,7 @@
 """
 return interpret_sw(self.sw, sw)

-class CardProfile(object):
+class CardProfile:
 """A Card Profile describes a card, it's filessystem hierarchy, an 
[initial] list of
applications as well as profile-specific SW and shell commands.  Every 
card has
one card profile, but there may be multiple applications within that 
profile."""
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index f946af8..d8579a3 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -23,7 +23,7 @@
 # along with this program.  If not, see .
 #

-class LinkBase(object):
+class LinkBase:
"""Base class for link/transport to card."""

def wait_for_card(self, timeout:int=None, newcardonly:bool=False):
diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py
index 467d5ee..49d649d 100644
--- a/pySim/transport/calypso.py
+++ b/pySim/transport/calypso.py
@@ -25,7 +25,7 @@
 from pySim.exceptions import *
 from pySim.utils import h2b, b2h

-class L1CTLMessage(object):
+class L1CTLMessage:

# Every (encoded) L1CTL message has the following structure:
#  - msg_length (2 bytes, net order)

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
Gerrit-Change-Number: 23633
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange