QQQ
import ipy_gmail
gml todo
ipy_gmail.to_leo(_, wb.MyTodo)
QQQ
Just posting this as an example of an interesting "productivity
feature" to emphasize how ileo reduces the amount of typing and
thinking that needs to be done. "gml" is a magic function introduced
in ipy_gmail that searches gmails with the specified label. You still
need to find this node and press alt+I, but once we get @button
working with ileo we can forget about that as well ;-)
--
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
> Has there been any more written about using Leo for gmail? Are there
> any plugins available?
Not really - but such a plugin would be very easy to write using libgmail:
http://libgmail.sourceforge.net/
What would perhaps be more interesting is imap plugin. Many people use
gmail for personal stuff, but imap is more widely available in
corporate setting (because Outlook supports imap) where archiving big
amounts of emails is a better use case.
E.g. Chandler ( http://chandlerproject.org/ ) operates by having a
dedicated folder on an imap server; similar setup could be handy for
leo as well.
--
Ville M. Vainio
http://tinyurl.com/vainio
> What would perhaps be more interesting is imap plugin. Many people use
> gmail for personal stuff, but imap is more widely available in
> corporate setting (because Outlook supports imap) where archiving big
> amounts of emails is a better use case.
And it seems gmail works just fine python imaplib. So who's the first
to create the leo email client?
Try out this program (if you have enabled imap on our gmail account):
QQQ
import getpass, imaplib
M = imaplib.IMAP4_SSL('imap.gmail.com', 993)
M.login(raw_input('username:') + '@gmail.com', getpass.getpass())
M.select()
typ, data = M.search(None, 'ALL')
for num in data[0].split():
typ, data = M.fetch(num, '(RFC822)')
print 'Message %s\n%s\n' % (num, data[0][1])
M.close()
M.logout()
QQQ
Try out this program (if you have enabled imap on our gmail account):
> Cool! It works as a stand-alone python app, but if I try to execute it as a
> Leo script I get this, endlessly repeated:
>
> QCoreApplication::exec: The event loop is already running
Ah, it's the raw_input.
Try removing it:
username = 'someusername'
passwd = 'foobar'
M.login(username + '@gmail.com', passwd)
Ah, it's the raw_input.
On Sat, May 9, 2009 at 2:36 PM, Edward K. Ream <edre...@gmail.com> wrote:
> Cool! It works as a stand-alone python app, but if I try to execute it as a
> Leo script I get this, endlessly repeated:
>
> QCoreApplication::exec: The event loop is already running
Try removing it:
Try out this program (if you have enabled imap on our gmail account):
Here are a few tweaks [snip]
> The new code creates nodes for each message, and puts the header in a
> child. This code finds the end of the header by searching for two
> consecutive newlines. Presumably there is an official way to do this, but
> it doesn't jump out at me.
The official way is doing proper mime parsing; that way you can save
attachments as well.
Module 'email' does this quite easily:
http://docs.python.org/library/email.parser.html
email.message_from_string() does the parsing, and after that you just
deal with the mime parts. In my libgmail hack, I took the body
something like this:
The official way is doing proper mime parsing; that way you can save
attachments as well.
Module 'email' does this quite easily:
http://docs.python.org/library/email.parser.html