Skip to content

Commit

Permalink
Please Python Linter
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
  • Loading branch information
juanlofer-eprosima committed Nov 17, 2023
1 parent 24ce009 commit c0be439
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions controller/controller_tool/tool/src/py/ControllerGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, current_dds_domain):
def get_dds_domain(self):
"""Return DDS Domain from spin box as integer value."""
return int(self.spin_box.value())


class DdsTopicNameDialog(QDialog):
"""Class that implements the a dialog to set the DDS command and status topic names."""
Expand Down Expand Up @@ -234,9 +234,15 @@ def on_ddsrecorder_status(self, previous_status, current_status, info):
# Change status bar
self.update_status(RecorderStatus[current_status.upper()])

def restart_controller(self, dds_domain=0, command_topic='/ddsrecorder/command', status_topic='/ddsrecorder/status'):
def restart_controller(
self,
dds_domain=0,
command_topic='/ddsrecorder/command',
status_topic='/ddsrecorder/status'):
"""Restart the DDS Controller if the DDS Domain or topic name changes."""
if dds_domain != self.dds_domain or command_topic != self.command_topic or status_topic != self.status_topic:
if (dds_domain != self.dds_domain
or command_topic != self.command_topic
or status_topic != self.status_topic):
if self.dds_controller.is_valid_dds_domain(dds_domain):
# Delete DDS entities in previous domain
self.dds_controller.delete_dds()
Expand Down Expand Up @@ -376,7 +382,7 @@ def dds_domain_dialog(self):
if domain != self.dds_domain:
if (self.dds_controller.is_valid_dds_domain(domain)):
self.restart_controller(domain, self.command_topic, self.status_topic)

def topic_name_dialog(self):
"""Create a dialog to update the recorder topic names."""
dialog = DdsTopicNameDialog(self.command_topic, self.status_topic)
Expand Down

0 comments on commit c0be439

Please sign in to comment.