diff --git a/scripts/wk/cfg/ddrescue.py b/scripts/wk/cfg/ddrescue.py index 7309236a..5a463ea9 100644 --- a/scripts/wk/cfg/ddrescue.py +++ b/scripts/wk/cfg/ddrescue.py @@ -1,16 +1,14 @@ """WizardKit: Config - ddrescue""" # vim: sts=2 sw=2 ts=2 -from collections import OrderedDict - # Layout TMUX_SIDE_WIDTH = 21 -TMUX_LAYOUT = OrderedDict({ +TMUX_LAYOUT = { 'Source': {'height': 2, 'Check': True}, 'Started': {'width': TMUX_SIDE_WIDTH, 'Check': True}, 'Progress': {'width': TMUX_SIDE_WIDTH, 'Check': True}, -}) +} # ddrescue AUTO_PASS_THRESHOLDS = { diff --git a/scripts/wk/cfg/ufd.py b/scripts/wk/cfg/ufd.py index 5670ae24..3643154c 100644 --- a/scripts/wk/cfg/ufd.py +++ b/scripts/wk/cfg/ufd.py @@ -1,18 +1,16 @@ """WizardKit: Config - UFD""" # vim: sts=2 sw=2 ts=2 -from collections import OrderedDict - from wk.cfg.main import KIT_NAME_FULL # General -SOURCES = OrderedDict({ +SOURCES = { 'Linux': {'Arg': '--linux', 'Type': 'ISO'}, 'WinPE': {'Arg': '--winpe', 'Type': 'ISO'}, 'Main Kit': {'Arg': '--main-kit', 'Type': 'KIT'}, 'Extra Dir': {'Arg': '--extra-dir', 'Type': 'DIR'}, - }) + } # Definitions: Boot entries BOOT_ENTRIES = { diff --git a/scripts/wk/clone/ddrescue.py b/scripts/wk/clone/ddrescue.py index 234d5c9c..34dd3e9d 100644 --- a/scripts/wk/clone/ddrescue.py +++ b/scripts/wk/clone/ddrescue.py @@ -14,8 +14,6 @@ import shutil import subprocess import time -from collections import OrderedDict - import psutil import pytz @@ -141,12 +139,12 @@ class BlockPair(): self.map_data = {} self.map_path = None self.size = source.size - self.status = OrderedDict({ + self.status = { 'read-skip': 'Pending', 'read-full': 'Pending', 'trim': 'Pending', 'scrape': 'Pending', - }) + } self.view_map = 'DISPLAY' in os.environ or 'WAYLAND_DISPLAY' in os.environ self.view_proc = None diff --git a/scripts/wk/kit/ufd.py b/scripts/wk/kit/ufd.py index d3715a4d..02d1294b 100644 --- a/scripts/wk/kit/ufd.py +++ b/scripts/wk/kit/ufd.py @@ -1,8 +1,6 @@ """WizardKit: UFD Functions""" # vim: sts=2 sw=2 ts=2 -# TODO: Drop OrderedDict use - import logging import math import os @@ -10,7 +8,6 @@ import pathlib import shutil from subprocess import CalledProcessError -from collections import OrderedDict from docopt import docopt from wk import io, log @@ -618,7 +615,7 @@ def update_boot_entries(ufd_dev, images=None) -> None: def verify_sources(args, ufd_sources) -> dict[str, pathlib.Path]: """Check all sources and abort if necessary, returns dict.""" - sources = OrderedDict() + sources = {} for label, data in ufd_sources.items(): s_path = args[data['Arg']] @@ -628,10 +625,11 @@ def verify_sources(args, ufd_sources) -> dict[str, pathlib.Path]: except FileNotFoundError: ui.print_error(f'ERROR: {label} not found: {s_path}') ui.abort() - if not is_valid_path(s_path_obj, data['Type']): - ui.print_error(f'ERROR: Invalid {label} source: {s_path}') - ui.abort() - sources[label] = s_path_obj + else: + if not is_valid_path(s_path_obj, data['Type']): + ui.print_error(f'ERROR: Invalid {label} source: {s_path}') + ui.abort() + sources[label] = s_path_obj return sources