Compare commits
No commits in common. "ee125daa0b6ce6fcfaad74e1aab58d0782d53f28" and "dbe3441e65e50b9d437bd6446422092fea4bc6cf" have entirely different histories.
ee125daa0b
...
dbe3441e65
@ -19,7 +19,7 @@ class fHDHR_INT_OBJ():
|
|||||||
|
|
||||||
self.web = fHDHR.tools.WebReq()
|
self.web = fHDHR.tools.WebReq()
|
||||||
|
|
||||||
self.api = fHDHR_API_URLs(settings, self.web)
|
self.api = fHDHR_API_URLs(settings)
|
||||||
|
|
||||||
|
|
||||||
class fHDHR_OBJ():
|
class fHDHR_OBJ():
|
||||||
|
|||||||
@ -1,26 +1,10 @@
|
|||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
|
|
||||||
class Fillin_Client():
|
|
||||||
|
|
||||||
def __init__(self, settings, web):
|
|
||||||
self.config = settings
|
|
||||||
self.web = web
|
|
||||||
|
|
||||||
def __getattr__(self, name):
|
|
||||||
''' will only get called for undefined attributes '''
|
|
||||||
if hasattr(self.web.session, name):
|
|
||||||
return eval("self.web.session." + name)
|
|
||||||
|
|
||||||
|
|
||||||
class fHDHR_API_URLs():
|
class fHDHR_API_URLs():
|
||||||
|
|
||||||
def __init__(self, settings, web):
|
def __init__(self, settings):
|
||||||
self.config = settings
|
self.config = settings
|
||||||
self.web = web
|
|
||||||
|
|
||||||
# Replaced later
|
|
||||||
self.client = Fillin_Client(settings, web)
|
|
||||||
|
|
||||||
self.address = self.config.dict["fhdhr"]["address"]
|
self.address = self.config.dict["fhdhr"]["address"]
|
||||||
self.discovery_address = self.config.dict["fhdhr"]["discovery_address"]
|
self.discovery_address = self.config.dict["fhdhr"]["discovery_address"]
|
||||||
|
|||||||
@ -74,7 +74,13 @@ def run(settings, logger, db, script_dir, fHDHR_web, origin, alternative_epg):
|
|||||||
# Hit EPG Update API URL without waiting
|
# Hit EPG Update API URL without waiting
|
||||||
fhdhr.logger.info("Waiting 3 seconds to send startup tasks trigger.")
|
fhdhr.logger.info("Waiting 3 seconds to send startup tasks trigger.")
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
fhdhr.api.client.get("/api/startup_tasks")
|
try:
|
||||||
|
fhdhr.web.session.get("%s/api/startup_tasks" % (fhdhr.api.base))
|
||||||
|
except fhdhr.web.exceptions.ReadTimeout:
|
||||||
|
pass
|
||||||
|
except fhdhr.web.exceptions.ConnectionError as e:
|
||||||
|
fhdhr.logger.warning("Startup tasks failed: %s" % e)
|
||||||
|
pass
|
||||||
|
|
||||||
# wait forever
|
# wait forever
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
@ -134,8 +134,3 @@ class WebReq():
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.session = requests.Session()
|
self.session = requests.Session()
|
||||||
self.exceptions = requests.exceptions
|
self.exceptions = requests.exceptions
|
||||||
|
|
||||||
def __getattr__(self, name):
|
|
||||||
''' will only get called for undefined attributes '''
|
|
||||||
if hasattr(self.session, name):
|
|
||||||
return eval("self.session." + name)
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user