Update app.py
Browse files
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
|
| 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 |
-
#
|
| 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..."),
|