Skip to content

Commit

Permalink
Merge pull request #25 from maqifrnswa/patch-1
Browse files Browse the repository at this point in the history
First setObjects, then dispatch notices
  • Loading branch information
xeroc committed Dec 21, 2015
2 parents 1bf0754 + f42513d commit 699c548
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions grapheneapi/graphenewsprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,9 @@ def onMessage(self, payload, isBinary):
""" Run registered call backs for individual object notices
"""
if res["method"] == "notice" :
for notice in res["params"][1][0]:
if "id" in notice :
self.setObject(notice["id"], notice)
self.dispatchNotice( notice )
else :
#print("Warning: Received a notice without id: " + str(notice));
pass # FIXME: get this object id
[ self.setObject(notice["id"], notice) for notice in res["params"][1][0] if "id" in notice ]
[ self.dispatchNotice( notice ) for notice in res["params"][1][0] if "id" in notice ]
#[ self.dispatchNotice( notice ) if "id" in notice else print("Warning: Received a notice without id: " + str(notice)) for notice in res["params"][1][0] ]
else :
print("Error! ", res)

Expand Down

0 comments on commit 699c548

Please sign in to comment.