[PATCH 1/2] Re: Proper error message on invalid configured repository type
nicolas.s-dev at laposte.net
Mon Dec 13 20:29:15 GMT 2010
On Mon, Dec 13, 2010 at 09:33:17AM -0600, Sebastian wrote:
> From: Sebastian Spaeth <Sebastian at SSpaeth.de>
> Previoiusly, we would just bomb out with a KeyError("Foo") if a user
> configured a repository Type=Foo. Or in case he tried to sync from a
> Maildir to a Maildir. Still abort with an Exception now, but with one
> that explains what actually had happened.
I've merge this patch, maybe a bit too fast...
> diff --git a/offlineimap/repository/repository.py b/offlineimap/repository/repository.py
> new file mode 100644
> index 0000000..edb5063
> --- /dev/null
> +++ b/offlineimap/repository/repository.py
> @@ -0,0 +1,67 @@
> +# Repository - abstract Repository class that returns the correct
> +# Repository type instance based on 'account' and 'reqtype', e.g.
> +# a ImapRepository instance
> +# Copyright (C) 2010 Sebastian Spaeth
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> +from offlineimap.repository.IMAP import IMAPRepository, MappedIMAPRepository
> +from offlineimap.repository.Gmail import GmailRepository
> +from offlineimap.repository.Maildir import MaildirRepository
> +from offlineimap.repository.LocalStatus import LocalStatusRepository
> +class Repository(object):
...From where is the "Repository" object used?
More information about the OfflineIMAP-project