laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35827?usp=email )
Change subject: pylint: apdu_source/pyshark_gsmtap ...................................................................... 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 --- M pySim/apdu_source/pyshark_gsmtap.py 1 file changed, 25 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/27/35827/1 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 @@ 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 @@ """ pyshark_inst = pyshark.FileCapture(pcap_filename, display_filter='gsm_sim', use_json=True, keep_packets=False) super().__init__(pyshark_inst) - -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35827?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0f2bfed2f671e02fc48bcc2a03c785edc691584f Gerrit-Change-Number: 35827 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <[email protected]> Gerrit-MessageType: newchange
