Skip to content

Commit

Permalink
fix inputhandler overlap properly
Browse files Browse the repository at this point in the history
  • Loading branch information
vysakh0 committed Aug 11, 2024
1 parent 75695fe commit 269d456
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/drd/cli/monitor/error_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,13 @@ def monitoring_handle_error_with_dravid(error, error_trace, monitor):
# error_type = type(error).__name__
# error_trace = ''.join(traceback.format_exception(
# type(error), error, error.__traceback__))
print("the type is *******")
print(error)
print("++++000-----")
project_context = monitor.metadata_manager.get_project_context()

print_info("Identifying relevant files for error context...")
error_details = f"""
There is an error in the project. Identify ony the files related to it
error_trace: {error}
"""
input("testing >")
input("testing1 >")
return True

files_to_check = run_with_loader(
lambda: get_files_to_modify(error_details, project_context),
Expand Down
12 changes: 10 additions & 2 deletions src/drd/cli/monitor/input_handler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import select
import click
import glob
import os
Expand All @@ -24,9 +25,16 @@ def handle_input(self):
self.logger.info("InputHandler triggered to handle input")
print_info("\nNo more tasks to auto-process. What can I do next?")
self._show_options()
user_input = input("")
user_input = self._get_input()
self.logger.info(f"Received user input: {user_input}")
self._process_input(user_input)
if user_input:
self._process_input(user_input)

def _get_input(self):
while self.monitor.get_state() == ServerState.NORMAL:
if sys.stdin in select.select([sys.stdin], [], [], 0.1)[0]:
return input("> ")
return None

def _show_options(self):
print_info("\nAvailable actions:")
Expand Down

0 comments on commit 269d456

Please sign in to comment.