This commit is contained in:
2025-01-24 10:35:42 +01:00
parent f1ee4089a3
commit b7eb2a1820
3 changed files with 2 additions and 22 deletions

View File

@@ -13,7 +13,6 @@ dependencies = [
"omegaconf>=2.3.0",
"prettytable>=3.12.0",
"pyqt6>=6.8.0",
"pyramid>=2.0.2",
"python-dotenv>=1.0.1",
"requests>=2.32.3",
]

View File

@@ -1,3 +1,2 @@
from .icon import Icon
from .stringtodate import stringToDate
from .documentation import launch_documentation

View File

@@ -1,33 +1,15 @@
from pyramid.config import Configurator
from wsgiref.simple_server import make_server
from src import docport, log
import os
import sys
def website():
config = Configurator()
# Set up static file serving from the 'site/' directory
config.add_static_view(
name="/", path=os.path.join(os.getcwd(), "site"), cache_max_age=3600
)
app = config.make_wsgi_app()
return app
def launch_documentation():
app = website()
server = make_server("localhost", 6543, app)
log.info("Serving MkDocs documentation on http://0.0.0.0:{}".format(docport))
def run_mkdocs():
with open(os.devnull, "w") as devnull:
old_stdout = sys.stdout
old_stderr = sys.stderr
sys.stdout = devnull
sys.stderr = devnull
try:
server.serve_forever()
os.system("mkdocs serve -q --no-livereload")
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr