From 02181db7118f9bb2cefbad624499d90efffdfcf6 Mon Sep 17 00:00:00 2001 From: Arnaud Taffanel Date: Wed, 30 Oct 2019 13:36:28 +0100 Subject: [PATCH] Fix new flake8 issues --- src/cfclient/ui/tabs/QualisysTab.py | 8 ++++---- src/cfclient/utils/input/__init__.py | 6 +++--- src/cfclient/utils/input/inputinterfaces/wiimote.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cfclient/ui/tabs/QualisysTab.py b/src/cfclient/ui/tabs/QualisysTab.py index 8b64abee..3ba39acd 100644 --- a/src/cfclient/ui/tabs/QualisysTab.py +++ b/src/cfclient/ui/tabs/QualisysTab.py @@ -253,7 +253,7 @@ def __init__(self, tabWidget, helper, *args): try: self.flight_paths = Config().get("flight_paths") - except Exception as err: + except Exception: logger.debug("No flight config") self.flight_paths = self.default_flight_paths @@ -725,7 +725,7 @@ def set_path_mode(self): # temp_position = [] temp = self.model.item(y, x) - except Exception as err: + except Exception: reading_data = False # remove the last "," element list = list[:(len(list) - 1)] @@ -896,7 +896,7 @@ def on_packet(self, packet): pitch=temp_cf_pos[1][1], yaw=temp_cf_pos[1][0]) - except ValueError as err: + except ValueError: self.qtmStatus = ' : connected : No 6DoF body found' try: @@ -909,7 +909,7 @@ def on_packet(self, packet): pitch=temp_wand_pos[1][1], yaw=temp_wand_pos[1][0]) - except ValueError as err: + except ValueError: self.qtmStatus = ' : connected : No 6DoF body found' if self._cf is not None and self.cf_pos.is_valid(): diff --git a/src/cfclient/utils/input/__init__.py b/src/cfclient/utils/input/__init__.py index ec3d3299..723b584c 100644 --- a/src/cfclient/utils/input/__init__.py +++ b/src/cfclient/utils/input/__init__.py @@ -117,7 +117,7 @@ def __init__(self, do_device_discovery=True): self._input_map = None - if Config().get("flightmode") is "Normal": + if Config().get("flightmode") == "Normal": self.max_yaw_rate = Config().get("normal_max_yaw") self.max_rp_angle = Config().get("normal_max_rp") # Values are stored at %, so use the functions to set the values @@ -386,8 +386,8 @@ def read_input(self): d.limit_rp = True if self._assisted_control == \ JoystickReader.ASSISTED_CONTROL_ALTHOLD: - self.assisted_control_updated.call( - data.assistedControl) + self.assisted_control_updated.call( + data.assistedControl) if ((self._assisted_control == JoystickReader.ASSISTED_CONTROL_HEIGHTHOLD) or (self._assisted_control == diff --git a/src/cfclient/utils/input/inputinterfaces/wiimote.py b/src/cfclient/utils/input/inputinterfaces/wiimote.py index 693ea836..cd05f3fd 100644 --- a/src/cfclient/utils/input/inputinterfaces/wiimote.py +++ b/src/cfclient/utils/input/inputinterfaces/wiimote.py @@ -24,7 +24,7 @@ class _Reader(object): def devices(self): """List all the available connections""" - raise NotImplemented() + raise NotImplementedError def open(self, device_id): """ @@ -38,7 +38,7 @@ def close(self, device_id): def read(self, device_id): """Read input from the selected device.""" - raise NotImplemented() + raise NotImplementedError TWO = 1