Commit Graph

1392 Commits

Author SHA1 Message Date
Nicolas Sebrecht
9afb432053 folder/IMAP.py: accord __version__ with import
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-27 19:45:14 +01:00
Nicolas Sebrecht
c84d6ea9c6 Merge branch 'ss/print-only-version-number-for-this-option' into next 2011-01-27 19:40:45 +01:00
Sebastian Spaeth
776b5173db have --version ONLY print the version number
Make --version much less verbose and only print out the version number
to facilitate easy parsing by scripts. We don't really need the verbose
copyright output, it is show with --help anyway.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-27 19:40:27 +01:00
Nicolas Sebrecht
0b5d15350d Merge branch 'ss/remove-multilock' into next 2011-01-25 19:19:34 +01:00
Sebastian Spaeth
83a85bb3fb Remove MultiLock implementation
Currently the Curses code is broken. Importing offlineimap.ui.Curses
will not succeed due to cyclic imports (threadutils imports ui, but ui
wants threadutils.MultiLock). So Curses cannot be chosen.

Incidentally, the only part in the code that uses "MultiLock" is the
Curses UI, to prevent concurrent access from several threads to the
ui-internal thread list and to IO resources such as the
screen. Fortunately for these purposes we don't need a MultiLock, so we
can do away with that implementation completely. A simple RLock that
allows us to have a thread "own" a lock and makes other threads wanting
access to the resource wait until the owning thread is finished.

The MultiLock implementation looked a bit weird, so simplifying code
here is a good thing, it might well be that we fix some "hangs" that
have been reported (and that would only ever occur with the Curses UI).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-25 19:19:14 +01:00
Thomas Schwinge
fa60f3f9b7 offlineimap.version is no more.
This fixes some leftover of 0b5b38d298.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-25 18:36:18 +01:00
Sebastian Spaeth
c8bdda656a State which CA certificate format we expect
Note in the example configuration file that CA cert files should be in
PEM format.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-24 22:25:51 +01:00
Nicolas Sebrecht
69c1b07bc7 v6.3.2-rc2
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-21 20:14:50 +01:00
Sebastian Spaeth
b47cc1d276 import getglobalui as we use it
This branch is currently broken, as we were using getglobalui() but it
was not imported. This fixes the missing import and makes offlineimap
run successfully.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-21 20:10:18 +01:00
Nicolas Sebrecht
a9c63078a2 Merge branch 'master' into next 2011-01-20 20:12:02 +01:00
Knut Anders Hatlen
9ad1810e43 understand multiple EXISTS replies from servers like Zimbra
Lars Thalmann <web@larsthalmann.com> writes:

> It seems some servers (Zimbra?) respond to imap SELECT requests with
> multiple EXISTS lines:
>
> ? SELECT INBOX
> * 500 EXISTS
> * 0 RECENT
> * 1000 EXISTS
> * 0 RECENT
> * 1500 EXISTS
> * 0 RECENT
> * 1567 EXISTS
> * 0 RECENT

Signed-off-by: Knut Anders Hatlen <kahatlen@gmail.com>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-20 20:06:46 +01:00
Sebastian Spaeth
c5d49cec3e Improve CustomConfig documentation
Improve documentation about what CustomConfigHelperMixin does,
it was not very clear without a close look to the code before.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-01-20 19:46:01 +01:00
Nicolas Sebrecht
d9a72c30ba produce better drafts for releases
Introduce Changelog.draft.rst in the releasing process. Using a dedicated file
for the WIP gives more readable diffs.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-19 20:13:38 +01:00
Nicolas Sebrecht
068df7d026 README: don't use github features for contributions
Display the warning ASAP to help not wasting time for newcomers. All kind of
contributions are expected at the mailing lists to bring posts a wider audience.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-19 20:02:24 +01:00
Nicolas Sebrecht
ab3caedf11 Merge branch 'ns/introduce-changelog' into next 2011-01-18 19:20:12 +01:00
Nicolas Sebrecht
8f6ac2c0c1 Changelog: fill in the WIP section
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-18 19:19:41 +01:00
Nicolas Sebrecht
5544c58391 involve the community to the process of releases
In software engineering the releasing process is an important step.  Since most
contributors are comfortable enough with the submitting patches process, it is
good time to involve everybody to the releasing one.

Introduce the Changelog file to rely on it. It is the good place to put topics
not already released.

This way, releases benefit from the review of others in the same way we do for
patches.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-18 19:19:41 +01:00
Nicolas Sebrecht
f89cece8e8 Merge branch 'ns/remove-UPGRADING' into next 2011-01-18 18:54:17 +01:00
Nicolas Sebrecht
7c24f08235 Merge branch 'ns/remove-offlineimap.spec' into next 2011-01-18 18:51:09 +01:00
Nicolas Sebrecht
2ad2be3077 Merge branch 'ns/makefile-cleaning' into next 2011-01-18 18:49:12 +01:00
Nicolas Sebrecht
921dd0aa52 Merge branch 'ns/makefile-create-build-and-run-as-default' into next 2011-01-18 18:47:57 +01:00
Nicolas Sebrecht
87d5ea3057 Merge branch 'master' into next 2011-01-18 18:40:29 +01:00
Sebastian Spaeth
9b85ffef89 Only verify hostname if we actually use CA certs
The current code path checked the CA cert host name, even if we did not
specify a CA cert file to use. Make the host name check dependent on a
CA cert file.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-18 18:39:38 +01:00
Nicolas Sebrecht
b81c8b58ed Makefile: fix cleaning path having whitespaces
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-16 18:01:45 +01:00
Nicolas Sebrecht
980ebb6f19 Makefile: don't remove unrelated files
Contributers don't expect to have their working files deleted on 'make clean'.
This process should only remove files created by the build mechanisms included in
the repository.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-16 18:01:00 +01:00
Nicolas Sebrecht
58355488a6 remove offlineimap.spec
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-16 17:48:35 +01:00
Nicolas Sebrecht
d5878d1892 Merge branch 'master' into next 2011-01-16 15:18:32 +01:00
Nicolas Sebrecht
48eb48946c convert SubmittingPatches to restructuredtext
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-16 15:16:55 +01:00
Nicolas Sebrecht
43e677497e remove UPGRADING file
Such information is handled in the docs/ directory. Don't provide more than one
way to get some documentation. Otherwise, it tends to be confusing or
fustrating.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-15 21:44:04 +01:00
Nicolas Sebrecht
4b5ea411d1 Merge branch 'master' into next 2011-01-15 21:19:49 +01:00
Nicolas Sebrecht
72285c92f5 README: fix the incorrect "reporting bugs" section
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-15 21:17:21 +01:00
Nicolas Sebrecht
5459063306 README: fix inconsistency in the level hierarchy
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-15 21:12:58 +01:00
Nicolas Sebrecht
aea3e88436 Makefile: learn to build the package and make it the default
It's a bit surprising to start the clean process when typing "make".
Create a build process and make it the default.

This will also help not deleting something VERY important.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-15 21:04:59 +01:00
Nicolas Sebrecht
f539682e0a Merge branch 'master' into next 2011-01-15 16:51:30 +01:00
Nicolas Sebrecht
6eb56364e7 doc: migrate from SGML to restructuredtext
This is a great move to help contributors in maintaining documentation.

While doing huge changes in this area, do a bit more than simply SGML to rst:

 * move README from markdown to rst
 * make a "true" man page with no more information
 * refactor content and sections

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-15 16:48:30 +01:00
Sebastian Spaeth
f7e9d9525d Imply single-threaded mode with -d(ebug) command line option
All invocations of -d will imply the single-threaded mode unless one of
the debug options is "thread" (in which case it would be senseless to
force single-threaded mode).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-14 19:25:29 +01:00
Sebastian Spaeth
b81b7d6001 Implement true single-threading
Previously, we would spawn child threads for account synchronization
even if we had single-threading enabled. This prevented us from catching
the true location of exceptions, for example. Now, in single-threaded
mode, we perform the account synchronization truely in the main thread
which will ease our debugging.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-14 19:25:11 +01:00
Sebastian Spaeth
760698253b LocalStatus: Don't ignore Exceptions on os.fsync
Earlier we would ignore *ALL* Exceptions that could occur during the
fsyncing of our LocalStatus database. Ignoring all Exceptions is not the
right thing here though. A recent commit improved the situation by
raising at least KeyboardInterrupt Exceptions, but that is still not
optimal.

os.fsync() is available on Unix, and Windows starting in python
2.2.3. so it should always work. If it doesn't, something is wrong.

It has been suggested to only catch EnvironmentError (ie SystemError and
OSError) here, but even those should be thrown. Something *is* wrong if
this fails and we should not ignore it.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-14 19:25:11 +01:00
Sebastian Spaeth
1a1e68d8be Catch KeyboardInterrupt exceptions explicitely
Previously we did not catch KeyboardInterrupts explicitly as all of the
code was executed in forked child threads which would never receive
Ctrl-c exceptions. With the upcoming single threaded modus, this code
can be run in the main thread however, so we need to take care of
KeyboardInterrupts explicitly.

This was done wherever we would catch *ALL* exceptions universally and
print out an error message.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-14 19:25:11 +01:00
Sebastian Spaeth
383ae9e647 Catch SystemExit and KeyboardInterrupt exceptions
Previously we did not catch KeyboardInterrupts explicitly as all of the
code was executed in forked child threads which would never receive
Ctrl-c exceptions. With the upcoming single threaded modus, this code
can be run in the main thread however, so we need to take care of
KeyboardInterrupts explicitly. As this is pretty highlevel code, we also
protect against receiving a SystemExit exception which is raised e.g. in
the ui.terminate() code by calling sys.exit().

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-14 19:25:11 +01:00
Sebastian Spaeth
fe9e5221b2 init.py: clean up 'import's
Make imports conform to PEP8 (one import per line), remove redundant or
unneeded imports.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-10 20:13:34 +01:00
Nicolas Sebrecht
3446aa9368 Merge branch 'ss/folder/base_clean-threadutil-import' into next
Conflicts:
	offlineimap/folder/Base.py
2011-01-10 18:58:05 +01:00
Sebastian Spaeth
a6b2b8014f folder/Base.py: No need to import InstanceLimitedThread explicitely
We already import threadutil, so no need to also import
threadutil.InstanceLimitedThread separately.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-10 18:56:39 +01:00
Nicolas Sebrecht
43096ad378 Merge branch 'ss/ui-remove-detector' into next 2011-01-07 19:38:12 +01:00
Sebastian Spaeth
c3540de763 Remove ui.detector class
The ui.detector class was not really needed and leads to the illusion
that we provide GUI plugins. For the sake of code maintainability we
don't :-).

Rather than having GUI names equivalent to the classes they are in
(which leads to weird names like TTY.TTYUI), this patch allows to give
each GUI an arbitrary string name. GUI names remain still unchanged in
this patch, the default UI when none was configured is TTY.TTYUI.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-07 19:37:48 +01:00
Nicolas Sebrecht
9d4ebe2072 Merge branch 'master' into next 2011-01-07 19:26:19 +01:00
Ethan Schoonover
ff3eb17b0f correct ssl ca-cert variable name in sample conf
The sample configuration file includes a minor misspelling in the
sslcacertfile variable, fixed herein.

Signed-off-by: Ethan Schoonover <es@ethanschoonover.com>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-07 19:25:45 +01:00
Nicolas Sebrecht
ee8a00cce2 Merge branch 'ss/ui' into next
Conflicts:
	offlineimap/folder/IMAP.py

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-05 19:31:08 +01:00
Sebastian Spaeth
de618d84f3 Save ui as self.ui in folder/Base class
Rather than regetting the ui with UIBase.getglobalui() all the time, we get it once in the base class and let all derivative classes just make use of self.ui rather than refetching the ui all the time, this makes for a bit less code and shorter lines.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-05 19:24:00 +01:00
Sebastian Spaeth
67089248da repository/*: replace UIBase.getglobalui() with getglobalui()
The latter is much shorter and looks nicer. UIBase was a very weird
name and with this patch, we don't need to use (or see) it from higher
level code anymore.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-01-05 19:24:00 +01:00