Skip to content

Commit 3eb4508

Browse files
committed
[#23897] Applied Ruff + notify error in textual pop-up
Signed-off-by: danipiza <dpizarrogallego@gmail.com>
1 parent 5dd265a commit 3eb4508

7 files changed

Lines changed: 122 additions & 190 deletions

File tree

src/vulcanai/console/console.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,6 @@ def __init__(
173173
self.suggestion_index = -1
174174
self.suggestion_index_changed = threading.Event()
175175

176-
177-
def set_stream_task(self, input_stream):
178-
"""
179-
Function used in the tools to set the current streaming task.
180-
with this variable the user can finish the execution of the
181-
task by using the signal "Ctrl + C"
182-
"""
183-
184-
self.stream_task = input_stream
185-
186176
async def on_mouse_down(self, event: MouseEvent) -> None:
187177
"""
188178
Function used to paste the string for the user clipboard
@@ -365,10 +355,10 @@ def worker(user_input: str = "") -> None:
365355
self.logger.log_console(f"Output of plan: {bb_ret}")
366356

367357
except KeyboardInterrupt:
368-
if self.stream_task == None:
358+
if self.stream_task is None:
369359
self.logger.log_msg("<yellow>Exiting...</yellow>")
370360
else:
371-
self.stream_task.cancel() # triggers CancelledError in the task
361+
self.stream_task.cancel() # triggers CancelledError in the task
372362
self.stream_task = None
373363
except EOFError:
374364
self.logger.log_msg("<yellow>Exiting...</yellow>")

src/vulcanai/console/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def on_request_start(self, text="Querying LLM..."):
6161
def on_request_end(self):
6262
self.spinner_status.stop()
6363

64+
6465
def attach_ros_logger_to_console(console, node):
6566
"""
6667
Function that remove ROS node overlaping prints in the terminal
@@ -81,6 +82,7 @@ def error_hook(msg, *args, **kwargs):
8182
logger.warning = warn_hook
8283
logger.error = error_hook
8384

85+
8486
def common_prefix(strings: str) -> str:
8587
if not strings:
8688
return ""

src/vulcanai/console/widget_custom_log_text_area.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,5 +383,5 @@ def action_copy_selection(self) -> None:
383383
except Exception as e:
384384
error_color = VulcanAILogger.vulcanai_theme["error"]
385385
self.append_line(f"<{error_color}>Clipboard error: {e}</{error_color}>")
386+
self.notify(f"Clipboard error: {e}")
386387
return
387-

src/vulcanai/core/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(
3333
k: int = 10,
3434
hist_depth: int = 3,
3535
logger: Optional[VulcanAILogger] = None,
36-
default_tools: bool = True
36+
default_tools: bool = True,
3737
):
3838
# Logger default to a stdout logger if none is provided (StdoutLogSink)
3939
self.logger = logger or VulcanAILogger.default()

src/vulcanai/core/manager_iterator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(
4343
logger=None,
4444
max_iters: int = 5,
4545
step_timeout_ms: Optional[int] = None,
46-
default_tools: bool = True
46+
default_tools: bool = True,
4747
):
4848
super().__init__(model, registry, validator, k, max(3, hist_depth), logger, default_tools)
4949

src/vulcanai/core/manager_plan.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,17 @@ def __init__(
3030
k: int = 5,
3131
hist_depth: int = 3,
3232
logger=None,
33-
default_tools=True
33+
default_tools=True,
3434
):
35-
super().__init__(model, registry=registry, validator=validator, k=k, hist_depth=hist_depth, logger=logger, default_tools=default_tools)
35+
super().__init__(
36+
model,
37+
registry=registry,
38+
validator=validator,
39+
k=k,
40+
hist_depth=hist_depth,
41+
logger=logger,
42+
default_tools=default_tools,
43+
)
3644

3745
def _get_prompt_template(self) -> str:
3846
"""

0 commit comments

Comments
 (0)