Commit 54f4b50c4263c53cba217b8812899b7a51018785

fix for bug #5

Commit diff

TODO

 
1* Better new messages control
2
3 Right now, the code only counts how many messages are on the
4 inbox. The logic is simple, and flawed. If you had 4 new messages
5 and now you have 5, you have a new message. But what happend if you
6 read one message and a new message arrives? the count will still be
7 4 and the system won't report the new message. What should be done
8 is store the messages id in a <insert data structure> so you can
9 have a real control of the messages count.
10
11* See-them-all option
12
13 There should be an option to open all the new messages with a single
14 click. If you use firefox, you may want to open in new tabs all your
15 messages, that would be nice.
16
17* Go to Google Mail homepage option
18
19 The title says all.
20
21* A plugin system
22
23 Right now gmail-sentinel is a monolithic design. What should be done
24 is to provide "callbacks" so you can register a plugin. What would
25 be ideal is to have this hooks
26
27 1.- Pre-connection (*)
28 2.- Pre-parsing (*Before parsing the atom feed)
29 3.- New message
30 4.- No message
31
32 Ideally, the notifications will use this plugin system. (* allowing
33 content modification before the parsing could be a security issue,
34 and pre-connection activities are discussible also. This is a
35 brainstorm so everything is changeable.)
36
37* Notification "skins"
38
39 Some ideas
40
41 - "full" see open/next/previous buttons and from/subject/summary data
42 - "minimal" just -> you have <n> new messages
43 - "medium" see open/next/previous buttons and from/subject data
44 - "last" see from/subject/summary data
45
46 and so on
toggle raw diff

gmail-sentinel.py

 
217217 print "login failed, will retry"
218218 self.status_icon.set_tooltip(_("Connection failed"))
219219 return False
220 self.connection.refreshInfo()
221 print "connection successful... continuing"
222 self.status_icon.set_tooltip(_("Connected"))
223 return True
220 if self.connection.refreshInfo():
221 print "connection successful... continuing"
222 self.status_icon.set_tooltip(_("Connected"))
223 return True
224 else:
225 print "connection failed"
226 self.status_icon.set_tooltip(_("Not connected"))
227 return False
224228
225229 def check_inbox(self):
226230 """Checks for new mail."""
227 # Revisar si esta el pop up y eliminarlo
228 if self.connection is None and self.connect() is False:
231 if self.connection is None or self.connect() is False:
229232 # Try again latter
230233 return True
231234 print "----------"
toggle raw diff

gmailatom.py

 
161161 def sendRequest(self):
162162 """Opens a conection with the remote server"""
163163 del self.mh.entries[:]
164 return urllib2.urlopen(self.url)
164 return urllib2.urlopen(self.url)
165165
166166 def refreshInfo(self):
167167 """Requests information from the remote server and parses the
168168 information retrieved"""
169 sax.parseString( self.sendRequest().read(), self.mh)
169 try:
170 sax.parseString( self.sendRequest().read(), self.mh)
171 return True
172 except urllib2.URLError:
173 return False
170174
171175 def getMsgList (self):
172176 """Returns a list containing the new messages or empty. It
toggle raw diff