chore: collapse multi-line argument definitions into single lines across multiple modules

This commit is contained in:
2025-11-04 07:10:37 +00:00
parent e9ced4a493
commit d58e2b56f2
44 changed files with 163 additions and 469 deletions
+5 -15
View File
@@ -95,9 +95,7 @@ def handle_command(assistant, command):
print(f"{Colors.BOLD}Available Tools:{Colors.RESET}")
for tool in get_tools_definition():
func = tool["function"]
print(
f"{Colors.CYAN}{func['name']}{Colors.RESET}: {func['description']}"
)
print(f"{Colors.CYAN}{func['name']}{Colors.RESET}: {func['description']}")
elif cmd == "/review" and len(command_parts) > 1:
filename = command_parts[1]
@@ -168,9 +166,7 @@ def handle_command(assistant, command):
def review_file(assistant, filename):
result = read_file(filename)
if result["status"] == "success":
message = (
f"Please review this file and provide feedback:\n\n{result['content']}"
)
message = f"Please review this file and provide feedback:\n\n{result['content']}"
from pr.core.assistant import process_message
process_message(assistant, message)
@@ -181,9 +177,7 @@ def review_file(assistant, filename):
def refactor_file(assistant, filename):
result = read_file(filename)
if result["status"] == "success":
message = (
f"Please refactor this code to improve its quality:\n\n{result['content']}"
)
message = f"Please refactor this code to improve its quality:\n\n{result['content']}"
from pr.core.assistant import process_message
process_message(assistant, message)
@@ -354,9 +348,7 @@ def show_conversation_history(assistant):
for conv in history:
import datetime
started = datetime.datetime.fromtimestamp(conv["started_at"]).strftime(
"%Y-%m-%d %H:%M"
)
started = datetime.datetime.fromtimestamp(conv["started_at"]).strftime("%Y-%m-%d %H:%M")
print(f"\n{Colors.CYAN}{conv['conversation_id']}{Colors.RESET}")
print(f" Started: {started}")
print(f" Messages: {conv['message_count']}")
@@ -536,9 +528,7 @@ def show_session_output(assistant, session_name):
for line in output:
print(line)
else:
print(
f"{Colors.YELLOW}No output available for session '{session_name}'{Colors.RESET}"
)
print(f"{Colors.YELLOW}No output available for session '{session_name}'{Colors.RESET}")
except Exception as e:
print(f"{Colors.RED}Error getting session output: {e}{Colors.RESET}")
+5 -15
View File
@@ -116,9 +116,7 @@ def kill_session(args):
close_interactive_session(session_name)
print(f"{Colors.GREEN}Session '{session_name}' terminated.{Colors.RESET}")
except Exception as e:
print(
f"{Colors.RED}Error terminating session '{session_name}': {e}{Colors.RESET}"
)
print(f"{Colors.RED}Error terminating session '{session_name}': {e}{Colors.RESET}")
def send_command(args):
@@ -132,13 +130,9 @@ def send_command(args):
try:
send_input_to_session(session_name, command)
print(
f"{Colors.GREEN}Sent command to '{session_name}': {command}{Colors.RESET}"
)
print(f"{Colors.GREEN}Sent command to '{session_name}': {command}{Colors.RESET}")
except Exception as e:
print(
f"{Colors.RED}Error sending command to '{session_name}': {e}{Colors.RESET}"
)
print(f"{Colors.RED}Error sending command to '{session_name}': {e}{Colors.RESET}")
def show_session_log(args):
@@ -220,9 +214,7 @@ def list_waiting_sessions(args=None):
waiting_sessions.append(session_name)
if not waiting_sessions:
print(
f"{Colors.GREEN}No sessions are currently waiting for input.{Colors.RESET}"
)
print(f"{Colors.GREEN}No sessions are currently waiting for input.{Colors.RESET}")
return
print(f"{Colors.BOLD}Sessions waiting for input:{Colors.RESET}")
@@ -237,9 +229,7 @@ def list_waiting_sessions(args=None):
if session_info:
suggestions = detector.get_response_suggestions({}, process_type)
if suggestions:
print(
f" Suggested inputs: {', '.join(suggestions[:3])}"
) # Show first 3
print(f" Suggested inputs: {', '.join(suggestions[:3])}") # Show first 3
print()