class BaseRepository(object, CustomConfig.ConfigHelperMixin):
led to TypeError: Cannot create a consistent method resolution
order (MRO) for bases ConfigHelperMixin, object. Switching the inherited
classes helps.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Replace low-level thread.get_ident() with threading.currentThread().ident.
This works both in python2.6 and python3. (thread is renamed _thread and its
direct use is not recommended)
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
all we want to know is if we got some string'ish type and testing for isinstance
'basestring' is sufficient for that. Remove the import.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
All we want to do here is to test whether we got a string'ish type or a list
(literal), so testing for basestring will be fine.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
'set' is builtin since python2.6, so remove the imports. Also 'ssl' exists
since 2.6 and has everything we need, so no need for conditional import
tests here anymore.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This import failed in python3, we need to either specify "." (relative) or
from OfflineImap.ui. (absolute). Done the latter.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
To have the code work in python3, we need to convert all occurences of
raise Exception, "text" to be proper functions. This style also adheres to PEP8.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We do not use ui.locked() anymore to output an error message, the text comes
directly from the exception.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Attempt to load first ConfigParser and then configparser. At some point this
should be switched to do the python3 thing first.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We mean the (numeric) logging level here and not the info() function.
logger.isEnabledFor() takes the logging level as argument,
obviously. This was a stupid typo that failed under python3.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
It can lead to potential dataloss (see recent commit log where I added a
scary warning about it to offlineimap.conf).
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Comment out all values that are the default values and make it a bit
more consistent in general. We should have a man page for those values,
really.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
1) Add helper functions to create and count maildirs and mails.
2) Add a second test that creates 2 maildirs, one of the including a
quotation sign " in its folder name and sync.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Blinkenlights does not work well (at all) when using the --info
switch. All we really want here is an output that can be pasted as
debugging information.
Enforce the usage of the "Basic" ui, when the --info switch is used.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Most servers support the UIDPLUS extension, and we don't have to search
headers after each uploaded message. There is no need to CHECK the imap
server after each message when there is no need to search headers.
I have not measured the performance impact on real world servers, but
this lets us do less unneeded work in the common case.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We were not cleaning out possibly existing APPENDUID messages before
APPENDing a new message. In case an old message were still hanging
around, this could *possibly* lead to retrieving and old UID. Things
should have been fine, but we do want to play safe here.
Also, make use of the "official" imaplib2 .response() command rather
than the internal _get_untagged_response() function.
Remove the hack that we would be looking for APPENDUID responses even if
the server claimed not to support the UIDPLUS ext. We now poll server
CAPABILITIES after login, and Gmail does provide us with the UIDPLUS
capability after login.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We used "self" but the paramter was called "s". Fixes a crash when we
ui.warn() (only when using the MachineUI).
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
imaputil.imapsplit did not cope with strings that contained encoded
quotation marks, e.g. a folder name '"Make" Magazine' would fail and
crash OfflineImap. Make it work by adapting the regex that we use to
extract the first quote to also work with encoded \" quotes. (We do no
sanity checks that there is an even number of such marks within a string
though)
This commit makes such folders work. This was reported and analyzed by
Mark Eichin.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Conflicts:
Changelog.draft.rst
imaputil.imapsplit did not cope with strings that contained encoded
quotation marks, e.g. a folder name '"Make" Magazine' would fail and
crash OfflineImap. Make it work by adapting the regex that we use to
extract the first quote to also work with encoded \" quotes. (We do no
sanity checks that there is an even number of such marks within a string
though)
This commit makes such folders work. This was reported and analyzed by
Mark Eichin.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Sebastian Spaeth wrote on Thu, Jan 19, 2012 at 10:28:19 +0100:
> Forgot to Cc the list...
>
> On Wed, 18 Jan 2012 08:17:44 +0200, Daniel Shahaf wrote:
> > Sebastian Spaeth wrote on Wed, Jan 18, 2012 at 01:02:22 +0100:
> >> http://docs.offlineimap.org
> >
> > I've subscribed. And if you tell me where the sources for docs.o.o are,
> > I'll send a patch for them, too. :-)
>
> They are autogenerated from docs/dev-docs-src, and
> docs/[INSTALL|MANUAL|FAQ].rst respectively. Patches are welcome...
>
> Sebastian
From 84fcb9fa5de9eb2f95d588a7403d9c6d13f0c7f0 Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@daniel.shahaf.name>
Date: Thu, 19 Jan 2012 11:53:13 +0200
Subject: [PATCH] Document the commits@ list
Mention the commits@ list in SubmittingPatches.rst.
Mention SubmittingPatches.rst in the API part of the documentation.
Signed-off-by: Daniel Shahaf <d.s@daniel.shahaf.name>
Rename getuidvalidity -> get_uidvalidity and cache the IMAP result.
1) Start modernizing our function names using more underscores
2) IMAPs implementation of get_uidvalidity was removing the UIDVALIDITY result
from the imaplib2 result stack, so subsequent calls would return "None".
As various functions can invoke this, this led to some errors that we
avoid by caching the current UIDVALIDITY value in the Folder instance.
There are more simplifications and improvements to be made.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Rename getuidvalidity -> get_uidvalidity and cache the IMAP result.
1) Start modernizing our function names using more underscores
2) IMAPs implementation of get_uidvalidity was removing the UIDVALIDITY result
from the imaplib2 result stack, so subsequent calls would return "None".
As various functions can invoke this, this led to some errors that we
avoid by caching the current UIDVALIDITY value in the Folder instance.
There are more simplifications and improvements to be made.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Don't create the temp dirs in the current directory, but create them in
the same directory as the credentials.conf file is. We still need to
prevent deleting them on test failure, so that they can be inspected
manually.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
"python setup.py test" will now run the complete test suite. Remove the
previous ./test command.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
To run the test suite from the main setup.py we need to be able to
import and run the test suite from a different folder than the "test"
dir.
Make "test" a package and fix the imports to still work when imported
from another folder.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This is the first revision that actually performs a test, in that it
starts up OfflineImap and sees if there are any exceptions.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
commit f2a94af5 introduced the use of time.sleep in ui/TTY.py without
importing it. This caused a regression in 6.5.2, crashing OfflineIMap
when in refresh mode.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We were using super() on a class derived from logging.Formatter() which
worked fine in python 2.7. Apparently python 2.6 uses old-style classes
for this, so the TTYUI broke and crashed OfflineImap. This was
introduced in OLI 6.5.0, I think.
Fix it by calling logging.Formatter.... directly, rather than the
elegant super() (which I happen to like a lot more than is appropriate
in the python world).
Reported by Nik Reiman as github issue 23, should fix that issue.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
commit f2a94af5 introduced the use of time.sleep in ui/TTY.py without
importing it. This caused a regression in 6.5.2, crashing OfflineIMap
when in refresh mode.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We were using super() on a class derived from logging.Formatter() which
worked fine in python 2.7. Apparently python 2.6 uses old-style classes
for this, so the TTYUI broke and crashed OfflineImap. This was
introduced in OLI 6.5.0, I think.
Fix it by calling logging.Formatter.... directly, rather than the
elegant super() (which I happen to like a lot more than is appropriate
in the python world).
Reported by Nik Reiman as github issue 23, should fix that issue.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>