aboutsummaryrefslogtreecommitdiffstats
path: root/pySim
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2024-02-04 22:46:29 +0100
committerHarald Welte <laforge@osmocom.org>2024-02-05 09:53:06 +0100
commit9bc016e7770fa774695ad35fe8390d85ccc5a755 (patch)
tree6ed4adbb788512bd55d1fb0191c42968d40b8205 /pySim
parent528d9225100724a928b71d2974775adc8754fd89 (diff)
pylint: apdu_source/pyshark_gsmtap
pySim/apdu_source/pyshark_gsmtap.py:90:0: C0305: Trailing newlines (trailing-newlines) pySim/apdu_source/pyshark_gsmtap.py:68:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) pySim/apdu_source/pyshark_gsmtap.py:30:0: C0411: first party import "from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/pyshark_gsmtap.py:31:0: C0411: first party import "from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/pyshark_gsmtap.py:32:0: C0411: first party import "from pySim.apdu.global_platform import ApduCommands as GpApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/pyshark_gsmtap.py:19:0: W0611: Unused import sys (unused-import) pySim/apdu_source/pyshark_gsmtap.py:21:0: W0611: Unused pprint imported from pprint as pp (unused-import) pySim/apdu_source/pyshark_gsmtap.py:25:0: W0611: Unused b2h imported from pySim.utils (unused-import) pySim/apdu_source/pyshark_gsmtap.py:26:0: W0611: Unused Tpdu imported from pySim.apdu (unused-import) Change-Id: I0f2bfed2f671e02fc48bcc2a03c785edc691584f
Diffstat (limited to 'pySim')
-rw-r--r--pySim/apdu_source/pyshark_gsmtap.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/pySim/apdu_source/pyshark_gsmtap.py b/pySim/apdu_source/pyshark_gsmtap.py
index aa7b624..83745e9 100644
--- a/pySim/apdu_source/pyshark_gsmtap.py
+++ b/pySim/apdu_source/pyshark_gsmtap.py
@@ -16,20 +16,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import sys
import logging
-from pprint import pprint as pp
from typing import Tuple
import pyshark
-from pySim.utils import h2b, b2h
-from pySim.apdu import Tpdu
+from pySim.utils import h2b
from pySim.gsmtap import GsmtapMessage
-from . import ApduSource, PacketType, CardReset
from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands
from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands
from pySim.apdu.global_platform import ApduCommands as GpApduCommands
+
+from . import ApduSource, PacketType, CardReset
+
ApduCommands = UiccApduCommands + UsimApduCommands + GpApduCommands
logger = logging.getLogger(__name__)
@@ -67,10 +66,10 @@ class _PysharkGsmtap(ApduSource):
sub_type = gsmtap_msg['sub_type']
if sub_type == 'apdu':
return ApduCommands.parse_cmd_bytes(gsmtap_msg['body'])
- elif sub_type == 'atr':
+ if sub_type == 'atr':
# card has been reset
return CardReset(gsmtap_msg['body'])
- elif sub_type in ['pps_req', 'pps_rsp']:
+ if sub_type in ['pps_req', 'pps_rsp']:
# simply ignore for now
pass
else:
@@ -87,4 +86,3 @@ class PysharkGsmtapPcap(_PysharkGsmtap):
"""
pyshark_inst = pyshark.FileCapture(pcap_filename, display_filter='gsm_sim', use_json=True, keep_packets=False)
super().__init__(pyshark_inst)
-