MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / get_project_choice

Function get_project_choice

start.py:110–128  ·  view source on GitHub ↗

Get user's project selection. Returns: Tuple of (name, path) for the selected project, or None if cancelled.

(projects: list[tuple[str, Path]])

Source from the content-addressed store, hash-verified

108
109
110def get_project_choice(projects: list[tuple[str, Path]]) -> tuple[str, Path] | None:
111 """Get user's project selection.
112
113 Returns:
114 Tuple of (name, path) for the selected project, or None if cancelled.
115 """
116 while True:
117 choice = input("Select project number: ").strip().lower()
118
119 if choice == 'b':
120 return None
121
122 try:
123 idx = int(choice) - 1
124 if 0 <= idx < len(projects):
125 return projects[idx]
126 print(f"Please enter a number between 1 and {len(projects)}")
127 except ValueError:
128 print("Invalid input. Enter a number or 'b' to go back.")
129
130
131def get_new_project_info() -> tuple[str, Path] | None:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected