[PATCH] fix: allow debugtype 'thread' from command line

Nicolas Sebrecht nicolas.s-dev at laposte.net
Thu May 12 23:16:40 BST 2011


commit f7e9d95 [Imply single-threaded mode with -d(ebug) command line option]
was broken. It pretends to imply singlethreading each time _unless_ user
explicitly asks for the debug 'thread' option.

Change the "force singlethreading" check from

  (force single threading if last column is true)

+------------------------------------------+----------------+
|                                          |                |
+---------------------------------+        |                |
|((SINGLETHREADING   THREAD_MODE) | "AND") | "NOT"          |
+------------------+--------------+--------+----------------+
| True             |  True        |  True  |  False (wrong) |
+------------------+--------------+--------+----------------+
| True             |  False       |  False |  True          |
+------------------+--------------+--------+----------------+
| False            |  True        |  False |  True (wrong)  |
+------------------+--------------+--------+----------------+
| False            |  False       |  False |  True          |
+------------------------------------------+----------------+

To the correct one

+--------------------------------------------------+-------+
|                                                  |       |
+-----------------------------------------+        |       |
|(("NOT" SINGLETHREADING    THREAD_MODE)  | "AND") | "NOT" |
+-------------------------+---------------+--------+-------+
| False                   | True          | False  | True  |
+-------------------------+---------------+--------+-------+
| False                   | False         | False  | True  |
+-------------------------+---------------+--------+-------+
| True                    | True          | True   | False |
+-------------------------+---------------+--------+-------+
| True                    | False         | False  | True  |
+-------------------------+---------------+----------------+

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev at laposte.net>
---
 offlineimap/init.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/offlineimap/init.py b/offlineimap/init.py
index 3aaa679..7258365 100644
--- a/offlineimap/init.py
+++ b/offlineimap/init.py
@@ -218,7 +218,7 @@ class OfflineImap:
                 options.debugtype = 'imap,maildir,thread'
             #force single threading?
             if not ('thread' in options.debugtype.split(',') \
-                    and options.singlethreading):
+                    and not options.singlethreading):
                 ui._msg("Debug mode: Forcing to singlethreaded.")
                 options.singlethreading = True
 
-- 
1.7.5.1.354.g761178





More information about the OfflineIMAP-project mailing list