introduce a virtual imaplib2
The virtual imaplib2 first try to import imaplib2 when provided by the system. If not provided or if the version is not supported, fallback on the bundled imaplib2 version. Distribution maintainers can now easily remove the bundled imaplib2 version if they want to get it packaged outside of offlineimap. We still want to provide imaplib2 by default because: - this library is neither in Python core nor packaged by a lot of distributions; - users expect to be able to run offlineimap by just downloading the tarball or after a git clone. In order to avoid unexpected (too old) versions of imaplib2, we restrict the supported versions of this librabry. Reviewed-by: Łukasz Żarnowiecki <dolohow@outlook.com> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
# imaplib utilities
|
||||
# Copyright (C) 2002-2015 John Goerzen & contributors
|
||||
# Copyright (C) 2002-2016 John Goerzen & contributors
|
||||
# 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
|
||||
@ -23,12 +23,12 @@ import threading
|
||||
from hashlib import sha1
|
||||
import socket
|
||||
import errno
|
||||
import zlib
|
||||
import six
|
||||
|
||||
from offlineimap.ui import getglobalui
|
||||
from offlineimap import OfflineImapError
|
||||
from offlineimap.imaplib2 import IMAP4, IMAP4_SSL, zlib, InternalDate, Mon2num
|
||||
|
||||
import six
|
||||
from offlineimap.virtual_imaplib2 import IMAP4, IMAP4_SSL, InternalDate, Mon2num
|
||||
|
||||
|
||||
class UsefulIMAPMixIn(object):
|
||||
|
Reference in New Issue
Block a user