Skip to content

Commit

Permalink
FIX: disable duplicate code in linter
Browse files Browse the repository at this point in the history
  • Loading branch information
amilcarlucas committed Nov 6, 2024
1 parent b547cd2 commit 11c7b1c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MethodicConfigurator/frontend_tkinter_component_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def argument_parser():
Returns:
argparse.Namespace: An object containing the parsed arguments.
"""
# pylint: disable=duplicate-code
parser = ArgumentParser(
description=_(
"A GUI for editing JSON files that contain vehicle component configurations. "
Expand All @@ -49,6 +50,7 @@ def argument_parser():
parser = LocalFilesystem.add_argparse_arguments(parser)
parser = ComponentEditorWindow.add_argparse_arguments(parser)
return add_common_arguments_and_parse(parser)
# pylint: enable=duplicate-code


class VoltageTooLowError(Exception):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def argument_parser():
Returns:
argparse.Namespace: An object containing the parsed arguments.
"""
# pylint: disable=duplicate-code
parser = ArgumentParser(
description=_(
"A GUI for editing JSON files that contain vehicle component configurations. "
Expand All @@ -49,6 +50,7 @@ def argument_parser():
parser = LocalFilesystem.add_argparse_arguments(parser)
parser = ComponentEditorWindowBase.add_argparse_arguments(parser)
return add_common_arguments_and_parse(parser)
# pylint: enable=duplicate-code


class ComponentEditorWindowBase(BaseWindow):
Expand Down
4 changes: 4 additions & 0 deletions MethodicConfigurator/frontend_tkinter_connection_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def __init__(self, flight_controller: FlightController, connection_result_string
option2_label = ttk.Label(text=_("Manual connection"), style="Bold.TLabel")
option2_label_frame = ttk.LabelFrame(self.main_frame, labelwidget=option2_label, borderwidth=2, relief="solid")
option2_label_frame.pack(expand=False, fill=tk.X, padx=6, pady=6)
# pylint: disable=duplicate-code
option2_label = ttk.Label(
option2_label_frame,
anchor=tk.CENTER,
Expand All @@ -191,6 +192,7 @@ def __init__(self, flight_controller: FlightController, connection_result_string
"manually select the fight controller connection or add a new one"
),
)
# pylint: enable=duplicate-code
option2_label.pack(expand=False, fill=tk.X, padx=6)
self.connection_selection_widgets = ConnectionSelectionWidgets(
self, option2_label_frame, flight_controller, destroy_parent_on_connect=True, download_params_on_connect=False
Expand Down Expand Up @@ -257,6 +259,7 @@ def argument_parser():
return add_common_arguments_and_parse(parser)


# pylint: disable=duplicate-code
def main():
args = argument_parser()

Expand All @@ -268,6 +271,7 @@ def main():
"another script"
)
)
# pylint: enable=duplicate-code

flight_controller = FlightController(args.reboot_time) # Initialize your FlightController instance
result = flight_controller.connect(device=args.device) # Connect to the flight controller
Expand Down
2 changes: 2 additions & 0 deletions MethodicConfigurator/frontend_tkinter_directory_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ def argument_parser():
return add_common_arguments_and_parse(parser)


# pylint: disable=duplicate-code
def main():
args = argument_parser()

Expand All @@ -498,6 +499,7 @@ def main():
" called from another script"
)
)
# pylint: enable=duplicate-code

local_filesystem = LocalFilesystem(args.vehicle_dir, args.vehicle_type, None, args.allow_editing_template_files)

Expand Down

0 comments on commit 11c7b1c

Please sign in to comment.