laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/35816?usp=email )

Change subject: pylint: ts_31_102_telecom.py
......................................................................

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
---
M pySim/ts_31_102_telecom.py
1 file changed, 24 insertions(+), 6 deletions(-)

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




diff --git a/pySim/ts_31_102_telecom.py b/pySim/ts_31_102_telecom.py
index 575ccae..962b7dd 100644
--- a/pySim/ts_31_102_telecom.py
+++ b/pySim/ts_31_102_telecom.py
@@ -26,11 +26,12 @@
 # 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.filesystem import *
 from pySim.construct import *
-from construct import Optional as COptional
-from construct import *

 # TS 31.102 Section 4.2.8
 class EF_UServiceTable(TransparentEF):
@@ -42,7 +43,7 @@
     def _bit_byte_offset_for_service(service: int) -> Tuple[int, int]:
         i = service - 1
         byte_offset = i//8
-        bit_offset = (i % 8)
+        bit_offset = i % 8
         return (byte_offset, bit_offset)

     def _decode_bin(self, in_bin):
@@ -73,7 +74,7 @@
             service_nr = int(srv)
             (byte_offset, bit_offset) = 
EF_UServiceTable._bit_byte_offset_for_service(
                 service_nr)
-            if in_json[srv]['activated'] == True:
+            if in_json[srv]['activated'] is True:
                 bit = 1
             else:
                 bit = 0
@@ -82,7 +83,7 @@
 
     def get_active_services(self, cmd):
         # obtain list of currently active services
-        (service_data, sw) = cmd.lchan.read_binary_dec()
+        (service_data, _sw) = cmd.lchan.read_binary_dec()
         active_services = []
         for s in service_data.keys():
             if service_data[s]['activated']:
@@ -121,7 +122,7 @@
         return num_problems

     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)

         for service in activate:

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35816?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: I4ee0d0e1b5b418b8527b4674141cbaef896a64a2
Gerrit-Change-Number: 35816
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-MessageType: merged

Reply via email to