diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index 5a029305..40c5fd4a 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -179,7 +179,7 @@ class State(): disable_tests = False # Skip already disabled devices - if all([test.disabled for test in disk.tests.values()]): + if all(test.disabled for test in disk.tests.values()): continue try: @@ -190,7 +190,7 @@ class State(): if 'Disk Attributes' in disk.tests: disk.tests['Disk Attributes'].failed = True disk.tests['Disk Attributes'].set_status('Failed') - except hw_obj.SMARTSelfTestInProgressError: + except hw_obj.SMARTSelfTestInProgressError as err: if prep: std.print_warning(f'SMART self-test(s) in progress for {disk.path}') if std.ask('Continue with all tests disabled for this device?'): @@ -199,7 +199,7 @@ class State(): std.print_standard('Diagnostics aborted.') std.print_standard(' ') std.pause('Press Enter to exit...') - raise SystemExit(1) + raise SystemExit(1) from err elif wait_for_self_tests: self_tests_in_progress = True else: @@ -907,10 +907,10 @@ def disk_io_benchmark(state, test_objects, skip_usb=True): stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ) - except PermissionError: + except PermissionError as err: # Since we're using sudo we can't kill dd # Assuming this happened during a CTRL+c - raise KeyboardInterrupt + raise KeyboardInterrupt from err match = IO_RATE_REGEX.search(proc.stdout) if match: read_rates.append( @@ -1046,7 +1046,7 @@ def disk_self_test(state, test_objects): state.update_progress_pane() try: while True: - if any([t.is_alive() for t in threads]): + if any(t.is_alive() for t in threads): std.sleep(1) else: break @@ -1125,7 +1125,7 @@ def disk_surface_scan(state, test_objects): continue match = BADBLOCKS_REGEX.search(line) if match: - if all([s == '0' for s in match.groups()]): + if all(s == '0' for s in match.groups()): test_obj.passed = True test_obj.report.append(f' {line}') test_obj.set_status('Passed') @@ -1168,7 +1168,7 @@ def disk_surface_scan(state, test_objects): # Wait for all tests to complete try: while True: - if any([t.is_alive() for t in threads]): + if any(t.is_alive() for t in threads): state.update_progress_pane() std.sleep(5) else: @@ -1583,7 +1583,7 @@ def run_diags(state, menu, quick_mode=False): state.ost.add_note() # Just return if no tests were selected - if not any([details['Enabled'] for details in state.tests.values()]): + if not any(details['Enabled'] for details in state.tests.values()): std.print_warning('No tests selected?') std.pause() return diff --git a/scripts/wk/hw/obj.py b/scripts/wk/hw/obj.py index 87b6c75f..ac44389e 100644 --- a/scripts/wk/hw/obj.py +++ b/scripts/wk/hw/obj.py @@ -62,11 +62,11 @@ class BaseObj(): def all_tests_passed(self): """Check if all tests passed, returns bool.""" - return all([results.passed for results in self.tests.values()]) + return all(results.passed for results in self.tests.values()) def any_test_failed(self): """Check if any test failed, returns bool.""" - return any([results.failed for results in self.tests.values()]) + return any(results.failed for results in self.tests.values()) class CpuRam(BaseObj): @@ -717,7 +717,7 @@ def get_disks(skip_kits=False): disks = [ disk_obj for disk_obj in disks if not any( - [WK_LABEL_REGEX.search(label) for label in disk_obj.get_labels()] + WK_LABEL_REGEX.search(label) for label in disk_obj.get_labels() ) ] diff --git a/scripts/wk/io.py b/scripts/wk/io.py index a29ccee6..f81d9a26 100644 --- a/scripts/wk/io.py +++ b/scripts/wk/io.py @@ -28,9 +28,9 @@ def case_insensitive_path(path): for part in parts: try: real_path = case_insensitive_search(real_path, part) - except NotADirectoryError: + except NotADirectoryError as err: # Reclassify error - raise FileNotFoundError(given_path) + raise FileNotFoundError(given_path) from err real_path = pathlib.Path(real_path) # Done diff --git a/scripts/wk/os/linux.py b/scripts/wk/os/linux.py index c4865bce..db7212b3 100644 --- a/scripts/wk/os/linux.py +++ b/scripts/wk/os/linux.py @@ -90,6 +90,7 @@ def mount(source, mount_point=None, read_write=False): def mount_volumes(device_path=None, read_write=False, scan_corestorage=False): + # pylint: disable=too-many-branches """Mount all detected volumes, returns list. NOTE: If device_path is specified then only volumes diff --git a/scripts/wk/os/win.py b/scripts/wk/os/win.py index 34d1220c..eadcab71 100644 --- a/scripts/wk/os/win.py +++ b/scripts/wk/os/win.py @@ -215,6 +215,7 @@ def run_sfc_scan(): # Registry Functions def reg_delete_key(hive, key, recurse=False): + # pylint: disable=raise-missing-from """Delete a key from the registry. NOTE: If recurse is False then it will only work on empty keys. diff --git a/setup/build_linux b/setup/build_linux index c9ec25da..0da67978 100755 --- a/setup/build_linux +++ b/setup/build_linux @@ -220,6 +220,9 @@ function update_live_env() { cp "$ROOT_DIR/images/Linux.jpg" "$PROFILE_DIR/airootfs/usr/share/wallpaper/burned.in" fi + # udevil + mkdir -p "$PROFILE_DIR/airootfs/media" + # WiFi IFS_BAK="${IFS}" IFS=$'\n'