File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,14 +119,18 @@ def evaluate_code(
119119
120120 if loop_match is None :
121121 return "ERROR: No event loop found. Add 'while True:', 'rclpy.spin(node)', or 'rclpy.spin_once(node)' or use 'Rate'"
122-
123- if "rclpy.spin" in loop_match .group () or "rclpy.spin_once" in loop_match .group () or ".create_rate" in loop_match .group ():
122+
123+ if (
124+ "rclpy.spin" in loop_match .group ()
125+ or "rclpy.spin_once" in loop_match .group ()
126+ or ".create_rate" in loop_match .group ()
127+ ):
124128 # Keep the code as-is; don't modify it
125129 pass
126130 else :
127131 # Modify code for while True (add frequency control)
128- sequential_code = code [:loop_match .start ()]
129- iterative_code = code [loop_match .start ():]
132+ sequential_code = code [: loop_match .start ()]
133+ iterative_code = code [loop_match .start () :]
130134 iterative_code = re .sub (loop_regex , "\n " , iterative_code , 1 )
131135 iterative_code = re .sub (r"^[ ]{4}" , "" , iterative_code , flags = re .M )
132136 code = sequential_code + iterative_code
Original file line number Diff line number Diff line change @@ -653,7 +653,7 @@ def find_docker_console():
653653
654654 # raise Exception("No active console other than /dev/pts/0")
655655 return consoles
656-
656+
657657 def prepare_RA_code (code_path ):
658658 f = open (code_path , "r" )
659659 code = f .read ()
@@ -675,7 +675,7 @@ def prepare_RA_code(code_path):
675675 else :
676676 console_path = find_docker_console ()
677677 for i in console_path :
678- with open (i , 'w' ) as console :
678+ with open (i , "w" ) as console :
679679 console .write (errors + "\n \n " )
680680
681681 raise Exception (errors )
You can’t perform that action at this time.
0 commit comments