refactor: clean up imports
This commit is contained in:
parent
f8ff71f4c7
commit
570d91f515
16
cli/main.py
16
cli/main.py
|
|
@ -1,4 +1,3 @@
|
||||||
from typing import Optional
|
|
||||||
import datetime
|
import datetime
|
||||||
import typer
|
import typer
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
@ -14,11 +13,8 @@ from rich.text import Text
|
||||||
from rich.live import Live
|
from rich.live import Live
|
||||||
from rich.table import Table
|
from rich.table import Table
|
||||||
from collections import deque
|
from collections import deque
|
||||||
import time
|
|
||||||
from rich.tree import Tree
|
|
||||||
from rich import box
|
from rich import box
|
||||||
from rich.align import Align
|
from rich.align import Align
|
||||||
from rich.rule import Rule
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
# Load environment variables from .env file
|
# Load environment variables from .env file
|
||||||
|
|
@ -76,11 +72,11 @@ class MessageBuffer:
|
||||||
}
|
}
|
||||||
|
|
||||||
def add_message(self, message_type, content):
|
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))
|
self.messages.append((timestamp, message_type, content))
|
||||||
|
|
||||||
def add_tool_call(self, tool_name, args):
|
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))
|
self.tool_calls.append((timestamp, tool_name, args))
|
||||||
|
|
||||||
def update_agent_status(self, agent, status):
|
def update_agent_status(self, agent, status):
|
||||||
|
|
@ -438,7 +434,7 @@ def get_user_selections():
|
||||||
selected_ticker = get_ticker()
|
selected_ticker = get_ticker()
|
||||||
|
|
||||||
# Step 2: Analysis date
|
# Step 2: Analysis date
|
||||||
default_date = datetime.datetime.now().strftime("%Y-%m-%d")
|
default_date = datetime.now().strftime("%Y-%m-%d")
|
||||||
console.print(
|
console.print(
|
||||||
create_question_box(
|
create_question_box(
|
||||||
"Step 2: Analysis Date",
|
"Step 2: Analysis Date",
|
||||||
|
|
@ -505,12 +501,12 @@ def get_analysis_date():
|
||||||
"""Get the analysis date from user input."""
|
"""Get the analysis date from user input."""
|
||||||
while True:
|
while True:
|
||||||
date_str = typer.prompt(
|
date_str = typer.prompt(
|
||||||
"", default=datetime.datetime.now().strftime("%Y-%m-%d")
|
"", default=datetime.now().strftime("%Y-%m-%d")
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
# Validate date format and ensure it's not in the future
|
# Validate date format and ensure it's not in the future
|
||||||
analysis_date = datetime.datetime.strptime(date_str, "%Y-%m-%d")
|
analysis_date = datetime.strptime(date_str, "%Y-%m-%d")
|
||||||
if analysis_date.date() > datetime.datetime.now().date():
|
if analysis_date.date() > datetime.now().date():
|
||||||
console.print("[red]Error: Analysis date cannot be in the future[/red]")
|
console.print("[red]Error: Analysis date cannot be in the future[/red]")
|
||||||
continue
|
continue
|
||||||
return date_str
|
return date_str
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue