Update app.py
Browse files
app.py
CHANGED
|
@@ -98,7 +98,7 @@ def create_salesforce_record(score, checklist_summary, missing_summary, status,
|
|
| 98 |
# Generate a unique Project ID based on the current timestamp
|
| 99 |
ist_tz = pytz.timezone("Asia/Kolkata")
|
| 100 |
current_time = datetime.now(ist_tz)
|
| 101 |
-
project_id = f"PROJ-{current_time.strftime('%Y%m%d-%H%M%S')}" # e.g., PROJ-20250526-
|
| 102 |
logging.info(f"Generated Project ID: {project_id}")
|
| 103 |
|
| 104 |
# Ensure inputs are properly formatted
|
|
@@ -109,7 +109,7 @@ def create_salesforce_record(score, checklist_summary, missing_summary, status,
|
|
| 109 |
logs = str(logs) if logs else ""
|
| 110 |
qa_report = str(qa_report) if qa_report else ""
|
| 111 |
punch_list_text = str(punch_list_text) if punch_list_text else ""
|
| 112 |
-
missing_documents = len(missing_summary.split(", "))
|
| 113 |
open_punch_items = int(open_punch_items) if open_punch_items is not None else 0
|
| 114 |
|
| 115 |
# Set timezone to Asia/Kolkata (IST) and get current time
|
|
@@ -349,7 +349,7 @@ def generate_pdf(score, checklist_summary, missing_summary, checklist_status, lo
|
|
| 349 |
|
| 350 |
# Gradio interface with updated UI
|
| 351 |
with gr.Blocks(css="""
|
| 352 |
-
.progress-container { background-color: #f0f0f0; width: 100%; height: 20px; border-radius: 5px;
|
| 353 |
.progress-bar { height: 100%; text-align: center; line-height: 20px; color: #000; font-size: 12px; }
|
| 354 |
.progress-bar.red { background-color: #FF0000; }
|
| 355 |
.progress-bar.yellow { background-color: #FFFF00; }
|
|
|
|
| 98 |
# Generate a unique Project ID based on the current timestamp
|
| 99 |
ist_tz = pytz.timezone("Asia/Kolkata")
|
| 100 |
current_time = datetime.now(ist_tz)
|
| 101 |
+
project_id = f"PROJ-{current_time.strftime('%Y%m%d-%H%M%S')}" # e.g., PROJ-20250526-103315
|
| 102 |
logging.info(f"Generated Project ID: {project_id}")
|
| 103 |
|
| 104 |
# Ensure inputs are properly formatted
|
|
|
|
| 109 |
logs = str(logs) if logs else ""
|
| 110 |
qa_report = str(qa_report) if qa_report else ""
|
| 111 |
punch_list_text = str(punch_list_text) if punch_list_text else ""
|
| 112 |
+
missing_documents = len(missing_summary.split(", ")) if missing_summary and missing_summary != "None" else 0
|
| 113 |
open_punch_items = int(open_punch_items) if open_punch_items is not None else 0
|
| 114 |
|
| 115 |
# Set timezone to Asia/Kolkata (IST) and get current time
|
|
|
|
| 349 |
|
| 350 |
# Gradio interface with updated UI
|
| 351 |
with gr.Blocks(css="""
|
| 352 |
+
.progress-container { background-color: #f0f0f0; width: 100%; height: 20px; border-radius: 5px; overflowJavascript hidden; position: relative; }
|
| 353 |
.progress-bar { height: 100%; text-align: center; line-height: 20px; color: #000; font-size: 12px; }
|
| 354 |
.progress-bar.red { background-color: #FF0000; }
|
| 355 |
.progress-bar.yellow { background-color: #FFFF00; }
|