nitrokey.nk3.updates¶
- class nitrokey.nk3.updates.UpdateUi¶
Bases:
ABC
- abstract abort(*msgs)¶
- Parameters:
msgs (Any)
- Return type:
Exception
- abstract abort_downgrade(current, image)¶
- abstract abort_pynitrokey_version(current, required)¶
- abstract confirm_download(current, new)¶
- abstract confirm_extra_information(extra_info)¶
- Parameters:
extra_info (List[str])
- Return type:
None
- abstract confirm_pynitrokey_version(current, required)¶
- abstract confirm_update(current, new)¶
- abstract download_progress_bar(desc)¶
- Parameters:
desc (str)
- Return type:
Iterator[Callable[[int, int], None]]
- abstract error(*msgs)¶
- Parameters:
msgs (Any)
- Return type:
Exception
- abstract finalization_progress_bar()¶
- Return type:
Iterator[Callable[[int, int], None]]
- abstract pre_bootloader_hint()¶
- Return type:
None
- abstract request_bootloader_confirmation()¶
- Return type:
None
- abstract update_progress_bar()¶
- Return type:
Iterator[Callable[[int, int], None]]
- class nitrokey.nk3.updates.Updater¶
Bases:
object
- __init__(ui, await_bootloader, await_device, ignore_warnings=frozenset({}))¶
- Parameters:
ui (UpdateUi)
await_bootloader (Callable[[], NK3Bootloader])
await_device (Callable[[int | None, Callable[[int, int], None] | None], NK3])
ignore_warnings (Set[Warning])
- Return type:
None
- update(device, image, update_version, ignore_pynitrokey_version=False)¶
- Parameters:
device (TrussedBase)
image (str | None)
update_version (str | None)
ignore_pynitrokey_version (bool)
- Return type:
- class nitrokey.nk3.updates.Warning¶
Bases:
Enum
A warning that can occur during a firmware update.
By default, these warnings abort the firmware update. This enum can be used to select types of warnings that should be ignored and not cause the firmware update to fail.
- IFS_MIGRATION_V2 = 'ifs-migration-v2'¶
- MISSING_STATUS = 'missing-status'¶
- SDK_VERSION = 'sdk-version'¶
- UPDATE_FROM_BOOTLOADER = 'update-from-bootloader'¶
- property message: str¶