euler314 commited on
Commit
68a2149
Β·
verified Β·
1 Parent(s): 517570d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -817,7 +817,7 @@ input('Press Enter to exit...')""",
817
  gr.Markdown("### πŸ“Š Compilation Progress")
818
  progress_bar = gr.HTML(create_progress_bar(0, "Ready to compile..."))
819
 
820
- # Real-time Logs Section (FIXED: removed scroll_to_output parameter)
821
  with gr.Column(visible=False) as logs_section:
822
  gr.Markdown("### πŸ“œ Real-time Compilation Logs")
823
  real_time_logs = gr.Textbox(
@@ -841,10 +841,10 @@ input('Press Enter to exit...')""",
841
  run_btn = gr.Button("πŸ§ͺ Test Run Binary", variant="secondary")
842
  run_output = gr.Markdown(label="Execution Output")
843
 
844
- # Variables to store state
845
  current_binary_path = gr.State(None)
846
  compilation_success = gr.State(False)
847
- log_queue = gr.State(queue.Queue())
848
 
849
  def update_progress_display(progress, status):
850
  """Update the progress bar display"""
@@ -852,7 +852,7 @@ input('Press Enter to exit...')""",
852
 
853
  def handle_compilation(code, requirements, packages, mode, extension):
854
  try:
855
- # Initialize log queue
856
  log_q = queue.Queue()
857
  current_logs = ""
858
 
@@ -893,7 +893,7 @@ input('Press Enter to exit...')""",
893
  thread = threading.Thread(target=get_result)
894
  thread.start()
895
 
896
- # Fixed: Progress simulation with proper string formatting
897
  progress_steps = [
898
  (0.1, "Checking Nuitka installation..."),
899
  (0.15, "Checking MinGW-w64 for Windows targets..." if extension == ".exe" else "Checking environment..."),
 
817
  gr.Markdown("### πŸ“Š Compilation Progress")
818
  progress_bar = gr.HTML(create_progress_bar(0, "Ready to compile..."))
819
 
820
+ # Real-time Logs Section
821
  with gr.Column(visible=False) as logs_section:
822
  gr.Markdown("### πŸ“œ Real-time Compilation Logs")
823
  real_time_logs = gr.Textbox(
 
841
  run_btn = gr.Button("πŸ§ͺ Test Run Binary", variant="secondary")
842
  run_output = gr.Markdown(label="Execution Output")
843
 
844
+ # Variables to store state (FIXED: Using None instead of queue.Queue())
845
  current_binary_path = gr.State(None)
846
  compilation_success = gr.State(False)
847
+ log_queue = gr.State(None) # Changed from queue.Queue() to None
848
 
849
  def update_progress_display(progress, status):
850
  """Update the progress bar display"""
 
852
 
853
  def handle_compilation(code, requirements, packages, mode, extension):
854
  try:
855
+ # Initialize log queue here instead of in State
856
  log_q = queue.Queue()
857
  current_logs = ""
858
 
 
893
  thread = threading.Thread(target=get_result)
894
  thread.start()
895
 
896
+ # Progress simulation with log updates
897
  progress_steps = [
898
  (0.1, "Checking Nuitka installation..."),
899
  (0.15, "Checking MinGW-w64 for Windows targets..." if extension == ".exe" else "Checking environment..."),