Use consistent labels
This commit is contained in:
parent
a28a754be1
commit
dc6de9cab0
2 changed files with 9 additions and 9 deletions
|
|
@ -1325,12 +1325,12 @@ def run_mprime_test(state, test):
|
||||||
|
|
||||||
# Wait
|
# Wait
|
||||||
sleep(1)
|
sleep(1)
|
||||||
except (KeyboardInterrupt, ThermalError) as err:
|
except (KeyboardInterrupt, ThermalLimitReachedError) as err:
|
||||||
# CTRL+c pressed or thermal threshold reached
|
# CTRL+c pressed or thermal limit reached
|
||||||
test.aborted = True
|
test.aborted = True
|
||||||
if isinstance(err, KeyboardInterrupt):
|
if isinstance(err, KeyboardInterrupt):
|
||||||
test.update_status('Aborted')
|
test.update_status('Aborted')
|
||||||
elif isinstance(err, ThermalError):
|
elif isinstance(err, ThermalLimitReachedError):
|
||||||
test.failed = True
|
test.failed = True
|
||||||
test.thermal_abort = True
|
test.thermal_abort = True
|
||||||
test.update_status('NS')
|
test.update_status('NS')
|
||||||
|
|
@ -1440,7 +1440,7 @@ def run_mprime_test(state, test):
|
||||||
' {YELLOW}Aborted{CLEAR}'.format(**COLORS))
|
' {YELLOW}Aborted{CLEAR}'.format(**COLORS))
|
||||||
if test.thermal_abort:
|
if test.thermal_abort:
|
||||||
test.report.append(
|
test.report.append(
|
||||||
' {RED}CPU temps exceeded threshold{CLEAR}'.format(**COLORS))
|
' {RED}CPU reached temperature limit{CLEAR}'.format(**COLORS))
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ REGEX_COLORS = re.compile(r'\033\[\d+;?1?m')
|
||||||
|
|
||||||
|
|
||||||
# Error Classes
|
# Error Classes
|
||||||
class ThermalError(Exception):
|
class ThermalLimitReachedError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -219,7 +219,7 @@ def save_average_temp(sensor_data, temp_label, seconds=10):
|
||||||
_data[temp_label] = sum(_data['Temps']) / len(_data['Temps'])
|
_data[temp_label] = sum(_data['Temps']) / len(_data['Temps'])
|
||||||
|
|
||||||
|
|
||||||
def update_sensor_data(sensor_data, thermal_threshold=None):
|
def update_sensor_data(sensor_data, thermal_limit=None):
|
||||||
"""Read sensors and update existing sensor_data, returns dict."""
|
"""Read sensors and update existing sensor_data, returns dict."""
|
||||||
json_data = get_raw_sensor_data()
|
json_data = get_raw_sensor_data()
|
||||||
for _section, _adapters in sensor_data.items():
|
for _section, _adapters in sensor_data.items():
|
||||||
|
|
@ -236,9 +236,9 @@ def update_sensor_data(sensor_data, thermal_threshold=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Check if thermal limit reached
|
# Check if thermal limit reached
|
||||||
if thermal_threshold and _section == 'CoreTemps':
|
if thermal_limit and _section == 'CoreTemps':
|
||||||
if max(_data['Current'], _data['Max']) >= thermal_threshold:
|
if max(_data['Current'], _data['Max']) >= thermal_limit:
|
||||||
raise ThermalError('CoreTemps above threshold')
|
raise ThermalLimitReachedError('CoreTemps reached limit')
|
||||||
|
|
||||||
|
|
||||||
def join_columns(column1, column2, width=55):
|
def join_columns(column1, column2, width=55):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue