mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-30 03:42:59 +03:00
pylint: ts_31_102_telecom.py
pySim/ts_31_102_telecom.py:45:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens) pySim/ts_31_102_telecom.py:33:0: W0401: Wildcard import construct (wildcard-import) pySim/ts_31_102_telecom.py:76:15: C0121: Comparison 'in_json[srv]['activated'] == True' should be 'in_json[srv]['activated'] is True' if checking for the singleton value True, or 'in_json[srv]['activated']' if testing for truthiness (singleton-comparison) pySim/ts_31_102_telecom.py:85:23: W0612: Unused variable 'sw' (unused-variable) pySim/ts_31_102_telecom.py:124:22: W0612: Unused variable 'sw' (unused-variable) pySim/ts_31_102_telecom.py:32:0: C0411: third party import "from construct import Optional as COptional" should be placed before "from pySim.tlv import *" (wrong-import-order) pySim/ts_31_102_telecom.py:33:0: C0411: third party import "from construct import *" should be placed before "from pySim.tlv import *" (wrong-import-order) Change-Id: I4ee0d0e1b5b418b8527b4674141cbaef896a64a2
This commit is contained in:
@@ -26,11 +26,12 @@ Needs to be a separate python module to avoid cyclic imports
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from construct import Optional as COptional
|
||||||
|
from construct import Struct, Int16ub, Int32ub
|
||||||
|
|
||||||
from pySim.tlv import *
|
from pySim.tlv import *
|
||||||
from pySim.filesystem import *
|
from pySim.filesystem import *
|
||||||
from pySim.construct import *
|
from pySim.construct import *
|
||||||
from construct import Optional as COptional
|
|
||||||
from construct import *
|
|
||||||
|
|
||||||
# TS 31.102 Section 4.2.8
|
# TS 31.102 Section 4.2.8
|
||||||
class EF_UServiceTable(TransparentEF):
|
class EF_UServiceTable(TransparentEF):
|
||||||
@@ -42,7 +43,7 @@ class EF_UServiceTable(TransparentEF):
|
|||||||
def _bit_byte_offset_for_service(service: int) -> Tuple[int, int]:
|
def _bit_byte_offset_for_service(service: int) -> Tuple[int, int]:
|
||||||
i = service - 1
|
i = service - 1
|
||||||
byte_offset = i//8
|
byte_offset = i//8
|
||||||
bit_offset = (i % 8)
|
bit_offset = i % 8
|
||||||
return (byte_offset, bit_offset)
|
return (byte_offset, bit_offset)
|
||||||
|
|
||||||
def _decode_bin(self, in_bin):
|
def _decode_bin(self, in_bin):
|
||||||
@@ -73,7 +74,7 @@ class EF_UServiceTable(TransparentEF):
|
|||||||
service_nr = int(srv)
|
service_nr = int(srv)
|
||||||
(byte_offset, bit_offset) = EF_UServiceTable._bit_byte_offset_for_service(
|
(byte_offset, bit_offset) = EF_UServiceTable._bit_byte_offset_for_service(
|
||||||
service_nr)
|
service_nr)
|
||||||
if in_json[srv]['activated'] == True:
|
if in_json[srv]['activated'] is True:
|
||||||
bit = 1
|
bit = 1
|
||||||
else:
|
else:
|
||||||
bit = 0
|
bit = 0
|
||||||
@@ -82,7 +83,7 @@ class EF_UServiceTable(TransparentEF):
|
|||||||
|
|
||||||
def get_active_services(self, cmd):
|
def get_active_services(self, cmd):
|
||||||
# obtain list of currently active services
|
# obtain list of currently active services
|
||||||
(service_data, sw) = cmd.lchan.read_binary_dec()
|
(service_data, _sw) = cmd.lchan.read_binary_dec()
|
||||||
active_services = []
|
active_services = []
|
||||||
for s in service_data.keys():
|
for s in service_data.keys():
|
||||||
if service_data[s]['activated']:
|
if service_data[s]['activated']:
|
||||||
@@ -121,7 +122,7 @@ class EF_UServiceTable(TransparentEF):
|
|||||||
return num_problems
|
return num_problems
|
||||||
|
|
||||||
def ust_update(self, cmd, activate=[], deactivate=[]):
|
def ust_update(self, cmd, activate=[], deactivate=[]):
|
||||||
service_data, sw = cmd.lchan.read_binary()
|
service_data, _sw = cmd.lchan.read_binary()
|
||||||
service_data = h2b(service_data)
|
service_data = h2b(service_data)
|
||||||
|
|
||||||
for service in activate:
|
for service in activate:
|
||||||
|
|||||||
Reference in New Issue
Block a user