#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import codecs


sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
try:
    with open("../eyepoint-s1/os_version.txt", "r", encoding="utf-8") as f:
        version = f.read()
except Exception:
    version = "not defined"

with open("templates/device_info_template.html", "r", encoding="utf-8") as file:
    template = file.read()

page = template.format(version=version)
print("Content-type: text/html\n")
print(page)
