Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion radicl/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ def __gt__(self, other):
if v > ov:
result = True
break

elif v < ov:
result = False
break
return result

def __repr__(self):
Expand Down
1 change: 0 additions & 1 deletion radicl/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from os.path import abspath, dirname, expanduser, isdir

import pandas as pd
from matplotlib import pyplot as plt
from termcolor import colored
from study_lyte.io import write_csv

Expand Down
15 changes: 11 additions & 4 deletions radicl/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def __init__(self, ext_api: RAD_API=None, debug=False):

self.debug = debug
self.api:RAD_API = ext_api
self.available_devices = []
self.available_devices = None

self.log = get_logger(__name__, debug=self.debug)

def update_devices(self):
self.log.info("Scanning for COM ports...")
self._available_devices = find_kw_port(['STMicroelectronics', 'STM32'])
self.available_devices = find_kw_port(['STMicroelectronics', 'STM32'])

@property
def serial_number(self):
Expand All @@ -60,11 +60,18 @@ def serial_number(self):

@property
def multiple_devices_available(self):
return len(self.available_devices) > 1
result = False
if self.available_devices is not None:
result = len(self.available_devices) > 1
return result

@property
def no_devices_available(self):
return len(self.available_devices) == 0
""" Returns True if no devices are available, False otherwise"""
result = True
if self.available_devices is not None:
result = len(self.available_devices) == 0
return result

def connect(self, device=None):
""" Attempt to establish a connection with the probe"""
Expand Down
5 changes: 4 additions & 1 deletion tests/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def test_firmware_ge(self, fw1, fw2, expected):
('0.2', '0.2', False),
('0.0.0.2', '0.0.0.1', True),
('0.0.0.1', '0.0.0.2', False),

('1.45.2.1', '1.46.5', False),
('1.46.2.1', '1.46.1.1', True),
('1.46.2.1', '1.46.2.2', False),
('1.46.2.1', '2', False),
])
def test_firmware_gt(self, fw1, fw2, expected):
comparison = (fw1 > fw2)
Expand Down
Loading