]> code.delx.au - offlineimap/commitdiff
Fixed locked() for noninteractive UIs
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 9 Oct 2007 23:12:22 +0000 (00:12 +0100)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 9 Oct 2007 23:12:22 +0000 (00:12 +0100)
From: "Mark A. Hershberger"

https://bugs.launchpad.net/ubuntu/+source/offlineimap/+bug/96710

the locked() method isn't implemented for non-interactive UIs, so
exceptions are thrown on cron jobs.  Ubuntu's new apport catches these
and ? well, you get the idea.

patch provided.

offlineimap/ui/Noninteractive.py

index 18b18a74a7a272a062750020a3ae9fd8a3c62b81..c86a903d8adc351f5448d19d2b2948d69f864eb2 100644 (file)
@@ -43,6 +43,9 @@ class Basic(UIBase):
             time.sleep(sleepsecs)
         return 0
 
+    def locked(s):
+        s.warn("Another OfflineIMAP is running with the same metadatadir; exiting.")
+
 class Quiet(Basic):
     def __init__(s, config, verbose = -1):
         Basic.__init__(s, config, verbose)