rework documentation launch, use generated files instead of pure mkdocs, add quiet handler for use with logging in terminal

This commit is contained in:
2025-07-03 07:20:57 +02:00
parent 30228fd267
commit a6d9498b39
5 changed files with 920 additions and 900 deletions

View File

@@ -1,11 +1,23 @@
from PySide6.QtCore import QThread
from src.utils.documentation import run_mkdocs
from PySide6.QtCore import QThread, Slot
from src.utils.documentation import website, QuietHandler
from wsgiref.simple_server import make_server
class DocumentationThread(QThread):
def __init__(self):
super().__init__()
self._server = None # store server so we can shut it down
def run(self):
# launch_documentation()
run_mkdocs()
self._server = make_server(
"localhost", 8000, website(), handler_class=QuietHandler
)
while not self.isInterruptionRequested():
self._server.handle_request()
@Slot() # slot you can connect to aboutToQuit
def stop(self):
self.requestInterruption() # ask the loop above to exit
if self._server:
self._server.shutdown() # unblock handle_request()