Enable arguments-renamed Pylint rule and fix warnings (#2842)
This commit is contained in:
parent
0dc77f8e8a
commit
f13f3d53b6
|
|
@ -52,11 +52,11 @@ class PartitioningList(ListManager):
|
|||
display_actions = list(self._actions.values())
|
||||
super().__init__(prompt, device_partitions, display_actions[:2], display_actions[3:])
|
||||
|
||||
def selected_action_display(self, partition: PartitionModification) -> str:
|
||||
if partition.status == ModificationStatus.Create:
|
||||
def selected_action_display(self, selection: PartitionModification) -> str:
|
||||
if selection.status == ModificationStatus.Create:
|
||||
return str(_('Partition - New'))
|
||||
else:
|
||||
return str(partition.dev_path)
|
||||
return str(selection.dev_path)
|
||||
|
||||
def filter_options(self, selection: PartitionModification, options: list[str]) -> list[str]:
|
||||
not_filter = []
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ class SubvolumeMenu(ListManager):
|
|||
]
|
||||
super().__init__(prompt, btrfs_subvols, [self._actions[0]], self._actions[1:])
|
||||
|
||||
def selected_action_display(self, subvolume: SubvolumeModification) -> str:
|
||||
return str(subvolume.name)
|
||||
def selected_action_display(self, selection: SubvolumeModification) -> str:
|
||||
return str(selection.name)
|
||||
|
||||
def _add_subvolume(self, preset: SubvolumeModification | None = None) -> SubvolumeModification | None:
|
||||
result = EditMenu(
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ class JSON(json.JSONEncoder, json.JSONDecoder):
|
|||
A safe JSON encoder that will omit private information in dicts (starting with !)
|
||||
"""
|
||||
|
||||
def encode(self, obj: Any) -> str:
|
||||
return super().encode(jsonify(obj))
|
||||
def encode(self, o: Any) -> str:
|
||||
return super().encode(jsonify(o))
|
||||
|
||||
|
||||
class UNSAFE_JSON(json.JSONEncoder, json.JSONDecoder):
|
||||
|
|
@ -96,8 +96,8 @@ class UNSAFE_JSON(json.JSONEncoder, json.JSONDecoder):
|
|||
UNSAFE_JSON will call/encode and keep private information in dicts (starting with !)
|
||||
"""
|
||||
|
||||
def encode(self, obj: Any) -> str:
|
||||
return super().encode(jsonify(obj, safe=False))
|
||||
def encode(self, o: Any) -> str:
|
||||
return super().encode(jsonify(o, safe=False))
|
||||
|
||||
|
||||
class SysCommandWorker:
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ class UserList(ListManager):
|
|||
]
|
||||
super().__init__(prompt, lusers, [self._actions[0]], self._actions[1:])
|
||||
|
||||
def selected_action_display(self, user: User) -> str:
|
||||
return user.username
|
||||
def selected_action_display(self, selection: User) -> str:
|
||||
return selection.username
|
||||
|
||||
def handle_action(self, action: str, entry: User | None, data: list[User]) -> list[User]:
|
||||
if action == self._actions[0]: # add
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ class ManualNetworkConfig(ListManager):
|
|||
]
|
||||
super().__init__(prompt, preset, [self._actions[0]], self._actions[1:])
|
||||
|
||||
def selected_action_display(self, nic: Nic) -> str:
|
||||
return nic.iface if nic.iface else ''
|
||||
def selected_action_display(self, selection: Nic) -> str:
|
||||
return selection.iface if selection.iface else ''
|
||||
|
||||
def handle_action(self, action: str, entry: Nic | None, data: list[Nic]) -> list[Nic]:
|
||||
if action == self._actions[0]: # add
|
||||
|
|
|
|||
|
|
@ -137,8 +137,8 @@ class CustomMirrorList(ListManager):
|
|||
self._actions[1:]
|
||||
)
|
||||
|
||||
def selected_action_display(self, mirror: CustomMirror) -> str:
|
||||
return mirror.name
|
||||
def selected_action_display(self, selection: CustomMirror) -> str:
|
||||
return selection.name
|
||||
|
||||
def handle_action(
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -134,7 +134,6 @@ max-line-length = 220
|
|||
disable = [
|
||||
"C",
|
||||
"R",
|
||||
"arguments-renamed",
|
||||
"attribute-defined-outside-init",
|
||||
"bad-indentation",
|
||||
"bare-except",
|
||||
|
|
|
|||
Loading…
Reference in New Issue