From fa5156331cee3203ee0239ee77bd8217d2b34db2 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Thu, 8 Dec 2022 21:29:08 +0900 Subject: [PATCH] [jsk_robot_startup] Combine two if to one --- .../jsk_robot_startup/scripts/smach_to_mail.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py b/jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py index 93cc020f7b..eb1ad5e1de 100755 --- a/jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py +++ b/jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py @@ -182,12 +182,13 @@ def _status_cb(self, msg): else: self.smach_state_list[caller_id].append(status_dict) - if self.send_every_transition: - if (self.use_google_chat - and not self.smach_state_list[caller_id] is None): - rospy.loginfo("Send every transition called") - self._send_google_chat( - self.smach_state_subject[caller_id], [status_dict]) + # send notification every transition + if (self.send_every_transition + and self.use_google_chat + and not self.smach_state_list[caller_id] is None): + rospy.loginfo("Send every transition called") + self._send_google_chat( + self.smach_state_subject[caller_id], [status_dict]) # If we received END/FINISH status, send email, etc... if status_str in ["END", "FINISH", "FINISH-SUCCESS", "FINISH-FAILURE"]: