Here's a real simple patch to add:
GmailAccount.getFolderCounts()
Which returns a dict of folder_name =>count. The "folders" here are a combination of the labels from
getLabelNames() and the "standard folders".
getFolderCount(folder_name) would be another possible
API for the same code.
This was desired to implement the mockup for
a desktop mail widget in:
http://mail.gnome.org/archives/online-desktop-list/2007-October/msg00010.html
The patch