Change classmethods to staticmethods (#4114)
This commit is contained in:
parent
43509d8ce1
commit
b1290672bb
|
|
@ -101,13 +101,8 @@ class Fido2:
|
||||||
|
|
||||||
return cls._cryptenroll_devices
|
return cls._cryptenroll_devices
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def fido2_enroll(
|
def fido2_enroll(hsm_device: Fido2Device, dev_path: Path, password: Password) -> None:
|
||||||
cls,
|
|
||||||
hsm_device: Fido2Device,
|
|
||||||
dev_path: Path,
|
|
||||||
password: Password,
|
|
||||||
) -> None:
|
|
||||||
worker = SysCommandWorker(f'systemd-cryptenroll --fido2-device={hsm_device.path} {dev_path}', peek_output=True)
|
worker = SysCommandWorker(f'systemd-cryptenroll --fido2-device={hsm_device.path} {dev_path}', peek_output=True)
|
||||||
pw_inputted = False
|
pw_inputted = False
|
||||||
pin_inputted = False
|
pin_inputted = False
|
||||||
|
|
|
||||||
|
|
@ -1495,9 +1495,8 @@ class DiskEncryption:
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def validate_enc(
|
def validate_enc(
|
||||||
cls,
|
|
||||||
modifications: list[DeviceModification],
|
modifications: list[DeviceModification],
|
||||||
lvm_config: LvmConfiguration | None = None,
|
lvm_config: LvmConfiguration | None = None,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
|
|
||||||
|
|
@ -266,8 +266,8 @@ class WifiConfiguredNetwork:
|
||||||
|
|
||||||
return networks
|
return networks
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def _extract_flags(cls, flag_string: str) -> list[str]:
|
def _extract_flags(flag_string: str) -> list[str]:
|
||||||
pattern = r'\[([^\]]+)\]'
|
pattern = r'\[([^\]]+)\]'
|
||||||
|
|
||||||
extracted_values = re.findall(pattern, flag_string)
|
extracted_values = re.findall(pattern, flag_string)
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,8 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
|
|
||||||
class FormattedOutput:
|
class FormattedOutput:
|
||||||
@classmethod
|
@staticmethod
|
||||||
def _get_values(
|
def _get_values(
|
||||||
cls,
|
|
||||||
o: 'DataclassInstance',
|
o: 'DataclassInstance',
|
||||||
class_formatter: str | Callable | None = None, # type: ignore[type-arg]
|
class_formatter: str | Callable | None = None, # type: ignore[type-arg]
|
||||||
filter_list: list[str] = [],
|
filter_list: list[str] = [],
|
||||||
|
|
@ -110,8 +109,8 @@ class FormattedOutput:
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def as_columns(cls, entries: list[str], cols: int) -> str:
|
def as_columns(entries: list[str], cols: int) -> str:
|
||||||
"""
|
"""
|
||||||
Will format a list into a given number of columns
|
Will format a list into a given number of columns
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue