From b7a9788c106179245ba6ea12b57145adcb07a7a0 Mon Sep 17 00:00:00 2001
From: "Robin.Mueller" <robin.mueller.m@gmail.com>
Date: Mon, 12 Oct 2020 11:36:47 +0200
Subject: [PATCH] python inspection run

---
 config/obsw_com_config.py       |  3 +--
 gui/obsw_backend_test.py        |  3 ++-
 requirements.txt                | 18 +++++++++---------
 tc/obsw_image_handler.py        |  2 +-
 tc/obsw_pus_tc_packer.py        |  3 ++-
 tc/obsw_tc_service5_17.py       |  2 +-
 tmtc_core                       |  2 +-
 utility/binary_writer.py        |  1 -
 utility/obsw_binary_uploader.py |  7 -------
 9 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/config/obsw_com_config.py b/config/obsw_com_config.py
index 3de6c28..93de2ba 100644
--- a/config/obsw_com_config.py
+++ b/config/obsw_com_config.py
@@ -41,8 +41,7 @@ def set_communication_interface(tmtc_printer: TmTcPrinter) -> Union[Communicatio
                 g.G_SERIAL_DLE_MAX_QUEUE_LEN, g.G_SERIAL_DLE_MAX_FRAME_SIZE, serial_timeout)
         elif g.G_COM_IF == g.ComIF.QEMU:
             communication_interface = QEMUComIF(
-                tmtc_printer=tmtc_printer, tm_timeout=g.G_TM_TIMEOUT,
-                tc_timeout_factor=g.G_TC_SEND_TIMEOUT_FACTOR)
+                tmtc_printer=tmtc_printer, serial_timeout=g.G_TM_TIMEOUT)
         else:
             communication_interface = DummyComIF(tmtc_printer=tmtc_printer)
         if not communication_interface.valid:
diff --git a/gui/obsw_backend_test.py b/gui/obsw_backend_test.py
index c21caee..d9e6c48 100644
--- a/gui/obsw_backend_test.py
+++ b/gui/obsw_backend_test.py
@@ -6,6 +6,7 @@ import logging
 
 LOGGER = get_logger()
 
+
 class TmTcBackend(Process):
     def __init__(self):
         from obsw_tmtc_client import TmTcHandler
@@ -20,7 +21,7 @@ class TmTcBackend(Process):
 
     def listen(self):
         self.conn = self.listener.accept()
-        LOGGER.info("TmTcBackend: Connection accepted from %s",str(self.listener.last_accepted))
+        LOGGER.info("TmTcBackend: Connection accepted from %s", str(self.listener.last_accepted))
         while True:
             msg = self.conn.recv()
             # do something with msg
diff --git a/requirements.txt b/requirements.txt
index 4a3f79d..4ac62a1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,7 @@
 aiohttp==3.6.2
 astroid==2.4.2
 async-timeout==3.0.1
-attrs==19.3.0
+attrs==20.2.0
 chardet==3.0.4
 colorama==0.4.3
 cpplint==1.5.4
@@ -9,18 +9,18 @@ crcmod>=1.7
 docopt==0.6.2
 future==0.18.2
 idna==2.10
-iso8601==0.1.12
-isort==5.4.2
+iso8601==0.1.13
+isort==5.6.3
 lazy-object-proxy==1.5.1
 mccabe==0.6.1
 multidict==4.7.6
-pylint>=2.5.3
-PyQt5>=5.15.0
-PyQt5-sip>=12.8.0
+pylint>=2.6.0
+PyQt5>=5.15.1
+PyQt5-sip>=12.8.1
 pyserial>=3.4
 PyYAML==5.3.1
 six==1.15.0
 toml==0.10.1
-typing-extensions==3.7.4.2
-wrapt==1.11.2
-yarl==1.5.1
+typing-extensions==3.7.4.3
+wrapt==1.12.1
+yarl==1.6.0
diff --git a/tc/obsw_image_handler.py b/tc/obsw_image_handler.py
index aa8a3f0..5f96ad6 100644
--- a/tc/obsw_image_handler.py
+++ b/tc/obsw_image_handler.py
@@ -1,5 +1,5 @@
 from tmtc_core.tc.obsw_pus_tc_base import PusTelecommand, Deque
-from  tc.obsw_tc_service8 import make_action_id
+from tc.obsw_tc_service8 import make_action_id
 from tmtc_core.utility.obsw_logger import get_logger
 from config.obsw_config import SW_IMAGE_HANDLER_ID
 
diff --git a/tc/obsw_pus_tc_packer.py b/tc/obsw_pus_tc_packer.py
index 613044a..5215268 100644
--- a/tc/obsw_pus_tc_packer.py
+++ b/tc/obsw_pus_tc_packer.py
@@ -34,7 +34,8 @@ class ServiceQueuePacker:
     def __init__(self):
         pass
 
-    def pack_service_queue(self, service: Union[int, str], op_code: int, service_queue: TcQueueT):
+    @staticmethod
+    def pack_service_queue(service: Union[int, str], op_code: int, service_queue: TcQueueT):
         if service == 2:
             return pack_service2_test_into(service_queue)
         if service == 3:
diff --git a/tc/obsw_tc_service5_17.py b/tc/obsw_tc_service5_17.py
index 170c16b..23dbd25 100644
--- a/tc/obsw_tc_service5_17.py
+++ b/tc/obsw_tc_service5_17.py
@@ -36,7 +36,7 @@ def pack_service5_test_into(tc_queue: TcQueueT) -> TcQueueT:
     return tc_queue
 
 
-def pack_service17_test_into(tc_queue: TcQueueT, op_code: int) -> TcQueueT:
+def pack_service17_test_into(tc_queue: TcQueueT, op_code: int = 0) -> TcQueueT:
     if op_code == 0:
         tc_queue.appendleft(("print", "Testing Service 17"))
         # ping test
diff --git a/tmtc_core b/tmtc_core
index 4dc01bb..f082c48 160000
--- a/tmtc_core
+++ b/tmtc_core
@@ -1 +1 @@
-Subproject commit 4dc01bbd094d741798c1df131e37860746dd081f
+Subproject commit f082c488cd363308cf6f92c190397a14036341b3
diff --git a/utility/binary_writer.py b/utility/binary_writer.py
index 577d7ba..c07ab66 100644
--- a/utility/binary_writer.py
+++ b/utility/binary_writer.py
@@ -18,7 +18,6 @@ def main():
     with open(file_path, "rb+") as file:
         # Read the first seven ARM vectors. The sixth one will be replaced.
         arm_vectors = file.read(4 * 7)
-        arm_vector_6 = arm_vectors[5*4:5*4 + 4]
         print("ARM vectors: ")
         # print(''.join('{:02x}'.format(x) for x in arm_vectors))
         for x in range(0, 28, 4):
diff --git a/utility/obsw_binary_uploader.py b/utility/obsw_binary_uploader.py
index ed98abd..d8f6d89 100644
--- a/utility/obsw_binary_uploader.py
+++ b/utility/obsw_binary_uploader.py
@@ -116,13 +116,6 @@ def perform_file_upload(com_if: CommunicationInterface, tmtc_printer: TmTcPrinte
         # now we calculate the hamming code
         pass
 
-    # Read file as binary file
-    if file_path != ():
-        with open(file_path, 'rb') as file:
-            data_to_read = bytearray(file.read())
-    else:
-        LOGGER.info("Specified path invalid..")
-
     tc_queue = deque()
 
     # Delete existing binary file first, otherwise data might be appended to otherwise
-- 
GitLab