Simplify dashboard
This commit is contained in:
parent
b7dd850c61
commit
05045c2a8e
|
@ -44,7 +44,7 @@ class Agora(object):
|
||||||
self.lc_dash = LoopingCall(self.dashboard)
|
self.lc_dash = LoopingCall(self.dashboard)
|
||||||
self.lc_dash.start(int(settings.Agora.RefreshSec))
|
self.lc_dash.start(int(settings.Agora.RefreshSec))
|
||||||
|
|
||||||
def dashboard(self, send_irc=True, formatted=False):
|
def dashboard(self, send_irc=True):
|
||||||
"""
|
"""
|
||||||
Returns a dict for the dashboard.
|
Returns a dict for the dashboard.
|
||||||
Calls hooks to parse dashboard info and get all contact messages.
|
Calls hooks to parse dashboard info and get all contact messages.
|
||||||
|
@ -60,10 +60,10 @@ class Agora(object):
|
||||||
for contact in dash["response"]["data"]["contact_list"]:
|
for contact in dash["response"]["data"]["contact_list"]:
|
||||||
contact_id = contact["data"]["contact_id"]
|
contact_id = contact["data"]["contact_id"]
|
||||||
dash_tmp[contact_id] = contact
|
dash_tmp[contact_id] = contact
|
||||||
fmt = self.dashboard_hook(dash_tmp)
|
|
||||||
|
# Call hook function
|
||||||
|
self.dashboard_hook(dash_tmp, send_irc=send_irc)
|
||||||
self.get_recent_messages()
|
self.get_recent_messages()
|
||||||
if formatted:
|
|
||||||
return fmt
|
|
||||||
return dash_tmp
|
return dash_tmp
|
||||||
|
|
||||||
def dashboard_hook(self, dash, send_irc=True):
|
def dashboard_hook(self, dash, send_irc=True):
|
||||||
|
|
Loading…
Reference in New Issue