aboutsummaryrefslogtreecommitdiffstats
path: root/project/shoutboxapicommunicator.py
diff options
context:
space:
mode:
authorjantuomi <jans.tuomi@gmail.com>2016-07-20 15:05:09 +0300
committerjantuomi <jans.tuomi@gmail.com>2016-07-20 15:05:09 +0300
commit2cb5a755d3d384d47e7c8c9690397f7f886a5915 (patch)
tree9061fcc3f9b2b062d53a9536b35ffee4dc596b9b /project/shoutboxapicommunicator.py
parent0659ea69359564ec8d230fe67ffbd61a14358fe4 (diff)
Replace last message dict with storing the last message id, fix type conversion problem
Diffstat (limited to 'project/shoutboxapicommunicator.py')
-rw-r--r--project/shoutboxapicommunicator.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/project/shoutboxapicommunicator.py b/project/shoutboxapicommunicator.py
index 7194c8f..4c7e0c0 100644
--- a/project/shoutboxapicommunicator.py
+++ b/project/shoutboxapicommunicator.py
@@ -24,9 +24,11 @@ class ShoutboxCommunicator(BaseCommunicator):
return
content = json.loads(r.text)
- logging.info("Messages:")
- for msg in content:
- logging.info("{}: {}".format(msg["user"], msg["text"]))
+
+ if len(content) > 0:
+ logging.info("Messages from shoutbox:")
+ for msg in content:
+ logging.info("{}: {}".format(msg["user"], msg["text"]))
return content