File: html_serve.py

package info (click to toggle)
python-hug 2.6.0-2.4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,072 kB
  • sloc: python: 8,938; sh: 99; makefile: 17
file content (15 lines) | stat: -rw-r--r-- 351 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os

import hug


DIRECTORY = os.path.dirname(os.path.realpath(__file__))


@hug.get("/get/document", output=hug.output_format.html)
def nagiosCommandHelp(**kwargs):
    """
    Returns command help document when no command is specified
    """
    with open(os.path.join(DIRECTORY, "document.html")) as document:
        return document.read()