Add skeleton for maxage/maxsize documentation. Also remove the old
nametrans.rst from the old doc location.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
The warn() method tries to set the color to red. This leads to a garbled
tty after endwin() has been called. So lets simply use the UIBase
implementation.
Signed-off-by: Christoph Höger <christoph.hoeger@tu-berlin.de>
Add one test for each of the functions in offlineimap.imaputil, to make
sure they keep working. These functions tests the internal innards of
the offlineimap module rather than invoking offlineimap as a program.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Somehow we failed if no dry-run setting had been specified in the config
file. This got caught thanks to extending the test suite with a stock
configuration.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
In 2.6 all logging classes are not the new-style ones, so they
have no mro() method and, thus, we can't use super() for them.
Since CursesLogHanler is singly-inherited method, there will
be no problems in usage of the explicit superclass name.
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We autodetect the folder separator on IMAP servers and ignore any 'sep'
setting in the repository section for IMAP servers. Detect if there is
such a setting and warn the user about it.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
1) Fix test #4 by deleting all local mailfolders remaining from previous
tests, the mailfolder count will be off, otherwise.
2) Make folder deletion work in python3, it weirdly enough needs to be
quoted like this to work in python3 (I found a python bug about this
somewhere).
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Previously folderfilters had to match both the local AND remote
name which caused unwanted behavior in combination with nametrans
rules. Make it operate on the untranslated remote names now and
clarify in the command line option help text.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
No need to keep a COPYING (GPL v2 license) AND a file COPYRIGHT in
the root. All files have the boilerplate anyway. Add the relevant
part on top of the COPYING file and do away with COPYRIGHT.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
`make` in the `docs` dir or `make doc` in the root dir will now
create the 1) man page and 2) the user documentation using sphinx
(requiring python-doctools, and sphinx).
The resulting user docs are in `docs/html`. You can also
only create the man pages with `make man` in the `docs` dir.
Also fixed all .rst conversion errors as requested by Gentoo downstream.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This is the first test that actually creates a (local) email and
syncs. We check the result of the sync operation, to see if the
server has actually been assigning a proper UID to the email and
bail out if not.
This test therefore excercises our ability to properly detect the
new UID of an APPENDED email. Obviously we still need some
IMAP<->IMAP tests too, but since this is the same codepath being
used for APPENDs in that case, it could also help to detect
instabilities there.
In order to get this test in, the OLITestLib got a few new helper
functions:
- delete_maildir
- create_mail
- get_maildir_uids
The test passes here. I invoke it via:
python -m unittest test.tests.test_01_basic.TestBasicFunctions.test_04_createmail
or run python setup.py test, to run the whole suite.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This reverts commit 4d47f7bf3c.
This is one of two candidates for introducing the instabilities that
John Wiegley observed. We need to reintroduce with careful testing only.
The original patch has been mostly reverted.
This reverts commit 47390e03d6.
It is one of two potential candidates for the APPENDUID
regression that John Wiegley reported. We need to examine this
carefully before reintroducing this patch.
Resolved Changelog.draft.rst conflict.
Tests work now with python 3 with the exception of the deletion of remote
testfolders which fails for some reasons.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We don't want to hammmer IMAP servers for the test series too much
to avoid being locked out. We will need a few tests to test
concurrent connections, but by default one connection should be fine.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Prevent savemessage(), and savemessageflags() to occur in dryrun mode in
all backends. Still need to protect against deletemessage().
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
IMAP, Maildir, and LocalStatus abort if in dry-run mode. IMAP and Maildir
will log that they "would have" created a new folder.
This will probably fail later on as we can not cache messagelists on
folder that don't exist, so --dry-run is not yet safe when new folders
have been created.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
1) Set attribute self.dryrun depending on whether we are in dry-run mode.
2) Don't actually call hooks in --dry-run (just log what you would
invoke
3) Don't write out the mbnames file in --dry-run mode.
Repository, and Folder levels still need to be protected in dry-run mode
as of now.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
And set the [general]dry-run=True setting if yes. It is not used yet.
Also set ui.dryrun to True so we can output what WE WOULD HAVE DONE in
dryrun mode.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
A convenience helper function that allows to set a configuration value
if the user has not explicitly configured anything ie the option does
not exist yet in the configuration. It won't do anything, if the option
exists.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We need to clean out the remote folders before we invoke the test suite.
Implement a helper function that does this, and improve the test output
(less verbose) and the setup.py --help-commands (more verbose). Document
that it is possible to run a single test only. (although it is not
guaranteed that a test does not rely on the output of previous tests).
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Bail out with a better Exception and error text. The whole mapped
UID situation needs to be improved though.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
If we cannot identify the new UID after a sendmessage(), log a better error
message, including the server response for better debugging.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
While improving the test suite, I noticed that we would not create folders on
the remote in some cases when we should (yay for test suites!). This is because
we were testing the untransposed LOCAL foldername and check if it existed on
the remote side when deciding whether we should potentially create a new folder.
Simplify the code by transposing the LOCAL folder names in dst_hash, saving us
to create another confusing "newsrc" temp variable. Make the code a bit more
readable by using dst_name_t to indicate we operate a transposed folder name.
This now passes test 03 (using invalid nametrans rules) when test 03 would pass
before.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Rename variable src_name to src_name_t to indicate that it is the transposed
name. Also rather than testing the hash thingie, we can simply test for
"if source_name_t in dst_folders" now.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This allows to compare folders directly with strings. It also allows
constructs such as "if 'moo' in repo.getfolders()".
See the code documentation for the exact behavior (it basically is equal if
it's the same instance *or* a string matching the untranslated folder name.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Use get_default_config and write_config_file (which can be handed an optional
config object), so we can manipulate configuration options easily from within
the test function.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Fill in more details on nametrans and folder filtering. Also give them a
separate section in our user documentation. Everything will be
immediately online at docs.offlineimap.org.
The main change is to describe the reverse nametrans settings that are
needed since 6.4.0 to support remote folder creation.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Fill in more details on nametrans and folder filtering. Also give them a
separate section in our user documentation. Everything will be
immediately online at docs.offlineimap.org.
The main change is to describe the reverse nametrans settings that are
needed since 6.4.0 to support remote folder creation.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
By default we sort folders alphabetically (for IMAP) according to their
transposed names. For python3, we need to bend a bit backwards to still
allow the use of a cmp() function for foldersort. While going through, I
discovered that we never sort folders for Maildir.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
There is no need to cast 0 to 'long' even if we want to compare it to long
numbers in modern pythons.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>