Commit 653546570de4ed72ad07022a9ff50198165228dc

fixed unread msg double counting + pdb in code

Commit diff

gmail-sentinel.py

 
120120 connection."""
121121 self.config = ConfigParser()
122122 self.read_msgs = list()
123 self.empty_msg_queue = True
123124 self.plugin_manager = PluginManager()
124125 self.connection = None
125126 self.unread_msg_count = 0
194194
195195 if not self.has_new_mail():
196196 logging.info("[Main] No new messages")
197 self.plugin_manager.emit_signal('no_new_messages')
197 self.plugin_manager.emit_signal('no_new_messages', empty_queue = self.empty_msg_queue)
198198 # Check again later
199 len(self.read_msgs) == 0 or \
199 if self.empty_msg_queue:
200200 self.status_icon.set_from_file(self.status_icon.inactive_icon)
201201 return True
202202 self.status_icon.set_from_file(self.status_icon.active_icon)
213213 self.connection.refreshInfo()
214214 msgs = self.connection.getMsgList()
215215 # are all the messages already seen?
216 import pdb
217 pdb.set_trace()
218216
219217 set1 = set(x["id"] for x in self.read_msgs)
220218 same_messages = set1.issuperset(x["id"] for x in msgs)
221 if not same_messages:
222 self.read_msgs = msgs[:]
219 self.empty_msg_queue = len(msgs) == 0
220 self.read_msgs = msgs[:]
223221 return not same_messages
224222 except Exception, ex:
225223 logging.exception("[Main] getUnreadMsgCount() failed, will try again later")
toggle raw diff