Closed piyueh closed 3 years ago
Hello @piyueh
IMO the imaplib2 should include a method to retrieve the imaplib2 version. Something like imaplib2.version(). Accessing to the internal variable xxxxx IMO is not the right method. Then, we can use this function in offlineipam3.
OTOH, I think is better split your patch in two patches, one for the "style" (spaces, emtpy lines) and other for the version.
Best regards, kix
Hi @thekix Yes I agree. I can probably do it later and push to this PR.
Ah, those removed spaces are automatically done by my editor. Not intentional...
@thekix Now there's a version
function that returns the version string. It can also return the version number as a tuple of (major, minor). I didn't make the change to the Python 2 version (the imaplib2.py
file) because Python 2 has already reached EOL.
Currently when
__init__.py
doesfrom .imaplib2 import *
,__version__
is not imported because it is not in__all__
. However, offlineimap 3 requires this variable to under the top-level package name ofimaplib2
. See line 75 inofflineimap3/init.py
: https://github.com/OfflineIMAP/offlineimap3/blob/1e7ef9e7e6952f5d29ef0f5c25fd062798de55f3/offlineimap/init.py#L75~This PR adds
__version__
to__all__
.~This PR adds a function
version()
toimaplib2.py3
to access__version__
. The plan is to modify the offlineimap 3 to use thisversion()
function.