[PATCH 2/2] Re: folder: Implement helper functions uidexists() and getmessageuidlist()

Nicolas Sebrecht nicolas.s-dev at laposte.net
Thu Mar 10 19:34:28 GMT 2011


On Wed, Mar 09, 2011 at 08:53:21AM +0100, Sebastian Spaeth wrote:
> 
> More convenient way to test if a certain uid exists and getting a list
> of all uids. Also, the SQL backend will have efficient overrides for
> these methods.
> 
> Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
> ---
>  offlineimap/folder/Base.py |   23 ++++++++++++++++-------
>  1 files changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py
> index ffbbbbb..318e5e6 100644
> --- a/offlineimap/folder/Base.py
> +++ b/offlineimap/folder/Base.py
> @@ -139,6 +139,15 @@ class BaseFolder:
>          You must call cachemessagelist() before calling this function!"""
>          raise NotImplementedException
>  
> +    def uidexists(self,uid):
                          ^

Missing a whitespace.

> +        """Returns True if uid exists"""
> +	return uid in self.getmessagelist()

Indentation is wrong.

> +
> +    def getmessageuidlist(self):
> +        """Gets a list of UIDs.
> +        You may have to call cachemessagelist() before calling this function!"""
> +	return self.getmessagelist().keys()

Ditto.

Otherwise, it looks good.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list