"""A small application that can be used to test a WSGI server and check it for WSGI compliance. """ from __future__ import annotations import os import sys import typing as t from textwrap import wrap from markupsafe import escape from . import __version__ as _werkzeug_version from .wrappers.request import Request from .wrappers.response import Response TEMPLATE = """\
This page displays all available information about the WSGI server and the underlying Python interpreter.
Python Version | %(python_version)s |
---|---|
Platform | %(platform)s [%(os)s] |
API Version | %(api_version)s |
Byteorder | %(byteorder)s |
Werkzeug Version | %(werkzeug_version)s |
The following python packages were installed on the system as Python eggs:
The following paths are the current contents of the load path. The following entries are looked up for Python packages. Note that not all items in this path are folders. Gray and underlined items are entries pointing to invalid resources or used by custom import hooks such as the zip importer.
Items with a bright background were expanded for display from a relative path. If you encounter such paths in the output you might want to check your setup as relative paths are usually problematic in multithreaded environments.
{value}
")
sys_path = []
for item, virtual, expanded in iter_sys_path():
class_ = []
if virtual:
class_.append("virtual")
if expanded:
class_.append("exp")
class_ = f' class="{" ".join(class_)}"' if class_ else ""
sys_path.append(f"