shaikhmohammedmujammil commited on
Commit
d1b238b
·
verified ·
1 Parent(s): 7782d8b

added PDF format too

Browse files
Files changed (3) hide show
  1. SDLC.py +0 -0
  2. app.py +76 -14
  3. requirements.txt +4 -1
SDLC.py CHANGED
The diff for this file is too large to render. See raw diff
 
app.py CHANGED
@@ -192,6 +192,23 @@ def initialize_state():
192
  st.session_state.previous_major_cycle = None # Track the previous cycle to detect changes
193
  logger.info("Streamlit session state initialized/reset.")
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  def update_display(new_content: str):
196
  """Updates the main display area content in the session state."""
197
  st.session_state.display_content = new_content
@@ -410,14 +427,45 @@ with st.sidebar:
410
  st.header("Downloads")
411
  st.caption("Access generated artifacts and code snapshots.")
412
 
413
- # Document Downloads
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  st.markdown("---")
415
- st.subheader("Documents")
416
- create_download_button(st.session_state.workflow_state.get("final_user_story_path"), "User Story", "text/markdown", "final_us")
417
- create_download_button(st.session_state.workflow_state.get("final_product_review_path"), "Product Review", "text/markdown", "final_pr")
418
- create_download_button(st.session_state.workflow_state.get("final_design_document_path"), "Design Document", "text/markdown", "final_dd")
419
- create_download_button(st.session_state.workflow_state.get("final_quality_analysis_path"), "QA Report", "text/markdown", "final_qa")
420
- create_download_button(st.session_state.workflow_state.get("final_deployment_path"), "Deployment Plan", "text/markdown", "final_deploy")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
 
422
  # UML Diagram Downloads
423
  st.markdown("---")
@@ -784,13 +832,27 @@ with main_col:
784
  "final_uml_codes": [], "final_code_files": [], "final_code_review": "",
785
  "final_security_issues": "", "final_test_code_files": [], "final_quality_analysis": "",
786
  "final_deployment_process": "",
787
- # File paths (initialize as None)
788
- "final_user_story_path": None, "final_product_review_path": None, "final_design_document_path": None,
789
- "final_uml_diagram_folder": None, "final_uml_png_paths": [],
790
- "final_review_security_folder": None, "review_code_snapshot_folder": None,
791
- "final_testing_folder": None, "testing_passed_code_folder": None,
792
- "final_quality_analysis_path": None, "final_code_folder": None,
793
- "final_deployment_path": None,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
794
  }
795
 
796
  # Update the main session state variables
 
192
  st.session_state.previous_major_cycle = None # Track the previous cycle to detect changes
193
  logger.info("Streamlit session state initialized/reset.")
194
 
195
+ # --- ADDED Initialization for MD/PDF Paths ---
196
+ st.session_state.refined_prompt_path = None
197
+ st.session_state.refined_prompt_pdf_path = None
198
+ st.session_state.final_user_story_path = None
199
+ st.session_state.final_user_story_pdf_path = None
200
+ st.session_state.final_product_review_path = None
201
+ st.session_state.final_product_review_pdf_path = None
202
+ st.session_state.final_design_document_path = None
203
+ st.session_state.final_design_document_pdf_path = None
204
+ st.session_state.final_quality_analysis_path = None
205
+ st.session_state.final_quality_analysis_pdf_path = None
206
+ st.session_state.final_deployment_path = None
207
+ st.session_state.final_deployment_pdf_path = None
208
+ # --- END ADDED ---
209
+
210
+ logger.info("Streamlit session state initialized/reset including PDF paths.")
211
+
212
  def update_display(new_content: str):
213
  """Updates the main display area content in the session state."""
214
  st.session_state.display_content = new_content
 
427
  st.header("Downloads")
428
  st.caption("Access generated artifacts and code snapshots.")
429
 
430
+ # --- MODIFIED: Document Downloads (MD and PDF) ---
431
+ st.markdown("---")
432
+ st.subheader("Documents") # Combined header
433
+
434
+ # Refined Prompt (Appears after Q&A cycle is complete)
435
+ st.markdown("**Requirements Cycle:**") # Header for this artifact
436
+ create_download_button(st.session_state.workflow_state.get("refined_prompt_path"), "Refined Prompt (MD)", "text/markdown", "refined_prompt_md", help_text="The final prompt generated after Q&A.")
437
+ create_download_button(st.session_state.workflow_state.get("refined_prompt_pdf_path"), "Refined Prompt (PDF)", "application/pdf", "refined_prompt_pdf", help_text="PDF version of the refined prompt.")
438
+ st.markdown("---") # Separator
439
+
440
+ # User Story
441
+ st.markdown("**User Story Cycle:**")
442
+ create_download_button(st.session_state.workflow_state.get("final_user_story_path"), "User Story (MD)", "text/markdown", "final_us_md")
443
+ create_download_button(st.session_state.workflow_state.get("final_user_story_pdf_path"), "User Story (PDF)", "application/pdf", "final_us_pdf")
444
  st.markdown("---")
445
+
446
+ # Product Review
447
+ st.markdown("**Product Review Cycle:**")
448
+ create_download_button(st.session_state.workflow_state.get("final_product_review_path"), "Product Review (MD)", "text/markdown", "final_pr_md")
449
+ create_download_button(st.session_state.workflow_state.get("final_product_review_pdf_path"), "Product Review (PDF)", "application/pdf", "final_pr_pdf")
450
+ st.markdown("---")
451
+
452
+ # Design Document
453
+ st.markdown("**Design Cycle:**")
454
+ create_download_button(st.session_state.workflow_state.get("final_design_document_path"), "Design Document (MD)", "text/markdown", "final_dd_md")
455
+ create_download_button(st.session_state.workflow_state.get("final_design_document_pdf_path"), "Design Document (PDF)", "application/pdf", "final_dd_pdf")
456
+ st.markdown("---")
457
+
458
+ # QA Report
459
+ st.markdown("**Quality Analysis Cycle:**")
460
+ create_download_button(st.session_state.workflow_state.get("final_quality_analysis_path"), "QA Report (MD)", "text/markdown", "final_qa_md")
461
+ create_download_button(st.session_state.workflow_state.get("final_quality_analysis_pdf_path"), "QA Report (PDF)", "application/pdf", "final_qa_pdf")
462
+ st.markdown("---")
463
+
464
+ # Deployment Plan
465
+ st.markdown("**Deployment Cycle:**")
466
+ create_download_button(st.session_state.workflow_state.get("final_deployment_path"), "Deployment Plan (MD)", "text/markdown", "final_deploy_md")
467
+ create_download_button(st.session_state.workflow_state.get("final_deployment_pdf_path"), "Deployment Plan (PDF)", "application/pdf", "final_deploy_pdf")
468
+ # --- END MODIFIED Document Downloads ---
469
 
470
  # UML Diagram Downloads
471
  st.markdown("---")
 
832
  "final_uml_codes": [], "final_code_files": [], "final_code_review": "",
833
  "final_security_issues": "", "final_test_code_files": [], "final_quality_analysis": "",
834
  "final_deployment_process": "",
835
+ # --- ADDED/MODIFIED: Initialize MD/PDF paths ---
836
+ "refined_prompt_path": None,
837
+ "refined_prompt_pdf_path": None,
838
+ "final_user_story_path": None,
839
+ "final_user_story_pdf_path": None,
840
+ "final_product_review_path": None,
841
+ "final_product_review_pdf_path": None,
842
+ "final_design_document_path": None,
843
+ "final_design_document_pdf_path": None,
844
+ "final_uml_diagram_folder": None,
845
+ "final_uml_png_paths": [],
846
+ "final_review_security_folder": None,
847
+ "review_code_snapshot_folder": None,
848
+ "final_testing_folder": None,
849
+ "testing_passed_code_folder": None,
850
+ "final_quality_analysis_path": None, # MD path
851
+ "final_quality_analysis_pdf_path": None, # PDF path
852
+ "final_code_folder": None,
853
+ "final_deployment_path": None, # MD path
854
+ "final_deployment_pdf_path": None, # PDF path
855
+ # --- END ADDED/MODIFIED ---
856
  }
857
 
858
  # Update the main session state variables
requirements.txt CHANGED
@@ -32,4 +32,7 @@ typing-extensions
32
  httpx
33
  requests
34
 
35
- nest_asyncio
 
 
 
 
32
  httpx
33
  requests
34
 
35
+ nest_asyncio
36
+
37
+ markdown-it-py
38
+ weasyprint