NR: bool.get, what

This commit is contained in:
Evelyn 2017-11-03 19:24:27 +00:00
parent 31e53e8bc4
commit 6bdeccac03

View file

@ -333,8 +333,9 @@ class Module(object):
datetime.utcnow().time().strftime("%H:%M:%S+0000"))
if eagle_url:
schedule_query = Utils.get_url("%s/schedule/%s/%s" % (eagle_url, service_id, datetime.now().date().isoformat()), json=True, headers={"x-eagle-key": eagle_key})
schedule = schedule_query.get("current")
segment = schedule.get("schedule_segment")
if schedule_query:
schedule = schedule_query["current"]
segment = schedule["schedule_segment"]
if not query and not schedule:
return event["stdout"].write("No service information is available for this identifier.")