Skip to content

Commit

Permalink
Refactor compiler_gui.py: Add threaded debugging for improved perform…
Browse files Browse the repository at this point in the history
…ance
  • Loading branch information
AIIrondev committed Jul 23, 2024
1 parent 3b1f144 commit 467455d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Code/compiler_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import os
from datetime import datetime
import threading

# Variables
content_compile = []
Expand Down Expand Up @@ -293,6 +294,11 @@ def compile_llsp3(file, directory, project_name):
os.rmdir(directory)
os.remove(os.path.join(directory, project_name + '.py')) # Remove this File if you want to debug the app / if the .llsp3 file is not working

def threaded_debug(function, value=False):
debug_thread = threading.Thread(target=debug_function, args=(function, value))
debug_thread.start()
debug_thread.join()

def main_debug(file):
"""
Main function for debugging the compiled file.
Expand All @@ -303,7 +309,7 @@ def main_debug(file):
for line in content_compile:
# Komentare herausfiltern
function, value = get_active_function(line)
debug_function(function, value)
threaded_debug(function, value)

def main(file):
"""
Expand Down

0 comments on commit 467455d

Please sign in to comment.