Tidy up a bit

This commit is contained in:
Lance Stout 2013-02-10 11:47:47 -08:00
parent 1a2db7fb11
commit 774bf35fab

View File

@ -52,7 +52,7 @@ class Gmail(BasePlugin):
self.xmpp.remove_handler('Gmail New Mail') self.xmpp.remove_handler('Gmail New Mail')
def _handle_new_mail(self, iq): def _handle_new_mail(self, iq):
log.info("Gmail: New email!") log.info('Gmail: New email!')
iq.reply().send() iq.reply().send()
self.xmpp.event('gmail_notification') self.xmpp.event('gmail_notification')
@ -61,10 +61,10 @@ class Gmail(BasePlugin):
last_tid = self._last_result_tid last_tid = self._last_result_tid
def check_callback(data): def check_callback(data):
self._last_result_time = data["gmail_messages"]["result_time"] self._last_result_time = data['gmail_messages']['result_time']
if data["gmail_messages"]["threads"]: threads = data['gmail_messages']['threads']
self._last_result_tid = \ if threads:
data["gmail_messages"]["threads"][0]["tid"] self._last_result_tid = threads[0]['tid']
if callback: if callback:
callback(data) callback(data)