fHDHR_ToonamiAftermath/fHDHR/http/pages/index_html.py
deathbybandaid 8ae419d14c first push
2020-12-05 11:08:04 -05:00

28 lines
1.0 KiB
Python

from flask import request, render_template
class Index_HTML():
endpoints = ["/index", "/index.html"]
endpoint_name = "page_index_html"
def __init__(self, fhdhr):
self.fhdhr = fhdhr
def __call__(self, *args):
return self.get(*args)
def get(self, *args):
tuners_in_use = self.fhdhr.device.tuners.inuse_tuner_count()
max_tuners = self.fhdhr.device.tuners.max_tuners
fhdhr_status_dict = {
"Script Directory": str(self.fhdhr.config.internal["paths"]["script_dir"]),
"Config File": str(self.fhdhr.config.config_file),
"Cache Path": str(self.fhdhr.config.internal["paths"]["cache_dir"]),
"Total Channels": len(self.fhdhr.device.channels.list),
"Tuner Usage": ("%s/%s" % (str(tuners_in_use), str(max_tuners))),
}
return render_template('index.html', request=request, fhdhr=self.fhdhr, fhdhr_status_dict=fhdhr_status_dict, list=list)