Update app.py
Browse files
app.py
CHANGED
|
@@ -245,30 +245,13 @@ def evaluate_readiness(logs, qa_report, punch_list_text):
|
|
| 245 |
punch_list_text = sanitize_input(punch_list_text)
|
| 246 |
|
| 247 |
# Process Project Logs (30% weight)
|
| 248 |
-
|
| 249 |
-
logs_pass = logs and
|
| 250 |
if logs_pass:
|
| 251 |
score += LOGS_WEIGHT
|
| 252 |
checklist_details.append("Logs: Completed")
|
| 253 |
else:
|
| 254 |
-
|
| 255 |
-
logs_lower = logs.lower()
|
| 256 |
-
if not logs or "invalid" in logs_lower:
|
| 257 |
-
missing_items.append("invalid")
|
| 258 |
-
elif "not finished" in logs_lower:
|
| 259 |
-
missing_items.append("not finished")
|
| 260 |
-
elif "not done" in logs_lower:
|
| 261 |
-
missing_items.append("not done")
|
| 262 |
-
elif "handover done" in logs_lower and ("mistake" in logs_lower or "error" in logs_lower):
|
| 263 |
-
missing_items.append("handover incomplete")
|
| 264 |
-
elif "to do" in logs_lower:
|
| 265 |
-
missing_items.append("to do")
|
| 266 |
-
elif "yet to start" in logs_lower or "not started" in logs_lower:
|
| 267 |
-
missing_items.append("yet to start")
|
| 268 |
-
elif "inprogress" in logs_lower or "in progress" in logs_lower:
|
| 269 |
-
missing_items.append("inprogress")
|
| 270 |
-
else:
|
| 271 |
-
missing_items.append("project logs incomplete")
|
| 272 |
checklist_details.append("Logs: Pending")
|
| 273 |
logging.info(f"Logs Check: {'Pass' if logs_pass else 'Fail'}, Score so far: {score}%")
|
| 274 |
|
|
|
|
| 245 |
punch_list_text = sanitize_input(punch_list_text)
|
| 246 |
|
| 247 |
# Process Project Logs (30% weight)
|
| 248 |
+
# Simplified condition: logs pass if they are non-empty and at least 5 characters long
|
| 249 |
+
logs_pass = logs and len(logs) >= 5
|
| 250 |
if logs_pass:
|
| 251 |
score += LOGS_WEIGHT
|
| 252 |
checklist_details.append("Logs: Completed")
|
| 253 |
else:
|
| 254 |
+
missing_items.append("project logs incomplete")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
checklist_details.append("Logs: Pending")
|
| 256 |
logging.info(f"Logs Check: {'Pass' if logs_pass else 'Fail'}, Score so far: {score}%")
|
| 257 |
|