diff --git a/cli/main.py b/cli/main.py index 9ebcbaa8..876c9be5 100644 --- a/cli/main.py +++ b/cli/main.py @@ -1,4 +1,3 @@ -from typing import Optional import datetime import typer from pathlib import Path @@ -14,11 +13,8 @@ from rich.text import Text from rich.live import Live from rich.table import Table from collections import deque -import time -from rich.tree import Tree from rich import box from rich.align import Align -from rich.rule import Rule from dotenv import load_dotenv # Load environment variables from .env file @@ -76,11 +72,11 @@ class MessageBuffer: } def add_message(self, message_type, content): - timestamp = datetime.datetime.now().strftime("%H:%M:%S") + timestamp = datetime.now().strftime("%H:%M:%S") self.messages.append((timestamp, message_type, content)) def add_tool_call(self, tool_name, args): - timestamp = datetime.datetime.now().strftime("%H:%M:%S") + timestamp = datetime.now().strftime("%H:%M:%S") self.tool_calls.append((timestamp, tool_name, args)) def update_agent_status(self, agent, status): @@ -438,7 +434,7 @@ def get_user_selections(): selected_ticker = get_ticker() # Step 2: Analysis date - default_date = datetime.datetime.now().strftime("%Y-%m-%d") + default_date = datetime.now().strftime("%Y-%m-%d") console.print( create_question_box( "Step 2: Analysis Date", @@ -505,12 +501,12 @@ def get_analysis_date(): """Get the analysis date from user input.""" while True: date_str = typer.prompt( - "", default=datetime.datetime.now().strftime("%Y-%m-%d") + "", default=datetime.now().strftime("%Y-%m-%d") ) try: # Validate date format and ensure it's not in the future - analysis_date = datetime.datetime.strptime(date_str, "%Y-%m-%d") - if analysis_date.date() > datetime.datetime.now().date(): + analysis_date = datetime.strptime(date_str, "%Y-%m-%d") + if analysis_date.date() > datetime.now().date(): console.print("[red]Error: Analysis date cannot be in the future[/red]") continue return date_str