This commit is contained in:
deathbybandaid 2020-12-10 00:08:30 -05:00
parent 304919b3b4
commit fa33f8df99
8 changed files with 51 additions and 40 deletions

View File

@ -1,27 +1,9 @@
from .origin_channels_standin import OriginChannels_StandIN
from .origin_epg_standin import OriginEPG_StandIN
import fHDHR.exceptions import fHDHR.exceptions
class OriginEPG_StandIN():
def __init__(self):
pass
def update_epg(self, channels):
return {}
class OriginChannels_StandIN():
def __init__(self):
pass
def get_channels(self):
return []
def get_channel_stream(self, chandict):
return None
class OriginServiceWrapper(): class OriginServiceWrapper():
def __init__(self, fhdhr, origin): def __init__(self, fhdhr, origin):
@ -40,6 +22,7 @@ class OriginServiceWrapper():
self.setup_success = True self.setup_success = True
self.fhdhr.logger.info("%s Setup Success" % self.servicename) self.fhdhr.logger.info("%s Setup Success" % self.servicename)
except fHDHR.exceptions.OriginSetupError as e: except fHDHR.exceptions.OriginSetupError as e:
self.originservice = None
self.fhdhr.logger.error(e) self.fhdhr.logger.error(e)
self.setup_success = False self.setup_success = False

View File

@ -0,0 +1,11 @@
class OriginChannels_StandIN():
def __init__(self):
pass
def get_channels(self):
return []
def get_channel_stream(self, chandict):
return None

View File

@ -0,0 +1,8 @@
class OriginEPG_StandIN():
def __init__(self):
pass
def update_epg(self, channels):
return {}

View File

@ -1,7 +1,6 @@
from .index_html import Index_HTML from .index_html import Index_HTML
from .origin_html import Origin_HTML
from .channels_html import Channels_HTML from .channels_html import Channels_HTML
from .guide_html import Guide_HTML from .guide_html import Guide_HTML
from .cluster_html import Cluster_HTML from .cluster_html import Cluster_HTML
@ -19,7 +18,6 @@ class fHDHR_Pages():
self.fhdhr = fhdhr self.fhdhr = fhdhr
self.index_html = Index_HTML(fhdhr) self.index_html = Index_HTML(fhdhr)
self.origin_html = Origin_HTML(fhdhr)
self.channels_html = Channels_HTML(fhdhr) self.channels_html = Channels_HTML(fhdhr)
self.channels_editor = Channels_Editor_HTML(fhdhr) self.channels_editor = Channels_Editor_HTML(fhdhr)
self.guide_html = Guide_HTML(fhdhr) self.guide_html = Guide_HTML(fhdhr)
@ -29,3 +27,5 @@ class fHDHR_Pages():
self.version_html = Version_HTML(fhdhr) self.version_html = Version_HTML(fhdhr)
self.diagnostics_html = Diagnostics_HTML(fhdhr) self.diagnostics_html = Diagnostics_HTML(fhdhr)
self.settings_html = Settings_HTML(fhdhr) self.settings_html = Settings_HTML(fhdhr)
self.origin_html = self.fhdhr.originwrapper.origin.Origin_HTML(fhdhr)

View File

@ -1,18 +0,0 @@
from flask import request, render_template
class Origin_HTML():
endpoints = ["/origin", "/origin.html"]
endpoint_name = "page_origin_html"
def __init__(self, fhdhr):
self.fhdhr = fhdhr
def __call__(self, *args):
return self.get(*args)
def get(self, *args):
origin_status_dict = self.fhdhr.originwrapper.get_status_dict()
origin_status_dict["Total Channels"] = len(self.fhdhr.device.channels.list)
return render_template('origin.html', request=request, fhdhr=self.fhdhr, origin_status_dict=origin_status_dict, list=list)

View File

@ -2,6 +2,7 @@
from .origin_service import * from .origin_service import *
from .origin_channels import * from .origin_channels import *
from .origin_epg import * from .origin_epg import *
from .origin_html import *
ORIGIN_NAME = "fHDHR_IPTVorg" ORIGIN_NAME = "fHDHR_IPTVorg"
ORIGIN_VERSION = "v0.5.0-beta" ORIGIN_VERSION = "v0.5.0-beta"

26
origin/origin_html.py Normal file
View File

@ -0,0 +1,26 @@
from flask import request, render_template_string
import pathlib
from io import StringIO
class Origin_HTML():
endpoints = ["/origin", "/origin.html"]
endpoint_name = "page_origin_html"
def __init__(self, fhdhr):
self.fhdhr = fhdhr
self.template_file = pathlib.Path(self.fhdhr.config.internal["paths"]["origin"]).joinpath('origin.html')
self.template = StringIO()
self.template.write(open(self.template_file).read())
def __call__(self, *args):
return self.get(*args)
def get(self, *args):
origin_status_dict = {"fart": True}
# origin_status_dict = self.fhdhr.originwrapper.originservice.get_status_dict()
origin_status_dict["Total Channels"] = len(self.fhdhr.device.channels.list)
return render_template_string(self.template, request=request, fhdhr=self.fhdhr, origin_status_dict=origin_status_dict, list=list)