[PATCH 4/4] Another way of locating UID of just saved message

Knut Anders Hatlen knut.hatlen at oracle.com
Wed Jul 27 16:10:02 UTC 2011


Vladimir.Marek at oracle.com writes:

> --- a/offlineimap/imaplib2.py
> +++ b/offlineimap/imaplib2.py
> @@ -185,6 +185,20 @@ class Request(object):
>  
>  
>  
> +class UnquotedString(object):
> +    """ String which will not be quoted when passed to IMAP4 command. It works
> +    because IMAP._checkquote skips anything which is not of a 'basestring'
> +    type.
> +    Fro example: 
> +        imapobj.uid('FETCH', UnquotedString('*:*'), 'rfc822.header')"""
> +    t=""
> +
> +    def __init__(self, text):
> +            self.t=text
> +
> +    def __repr__(self):
> +            return self.t
> +
>  
>  class IMAP4(object):

I'm not familiar with the internals of OfflineIMAP, but I'm under the
impression that imaplib2 is a third-party library bundled with
OfflineIMAP. If so, it's probably better not to change that file, so
that it doesn't diverge from the upstream sources. (Don't take my word
for it. Someone who actually knows the code should comment on it, but I
thought I should raise the issue.)

Thanks for working on this, Vlad! It will be a very useful improvement.

-- 
Knut Anders




More information about the OfflineIMAP-project mailing list