summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiegfried-Angel Gevatter Pujals <rainct@ubuntu.com>2012-07-09 18:12:42 +0200
committerSiegfried-Angel Gevatter Pujals <rainct@ubuntu.com>2012-07-09 18:12:42 +0200
commita44b62ec6eb555d7beb9f26a604c94887556fac6 (patch)
tree71ea0716f01b6a28795bb06f77f70202b414b111
parentc1fcc692aba1cd788e7e8cb4efc1ce79248a20c7 (diff)
Vim data-source: fix exception handling
(Also note that the Python API handle reconnection correctly now.)
-rw-r--r--vim/zeitgeist.vim10
1 files changed, 3 insertions, 7 deletions
diff --git a/vim/zeitgeist.vim b/vim/zeitgeist.vim
index 3396ab6..36134c7 100644
--- a/vim/zeitgeist.vim
+++ b/vim/zeitgeist.vim
@@ -8,10 +8,6 @@ use_id = vim.eval("a:vim_use_id")
filename = vim.eval("a:filename")
precond = os.getuid() != 0 and os.getenv('DBUS_SESSION_BUS_ADDRESS') != None
if got_zeitgeist and precond and filename:
- # We reconnect on every attempt so that we cope cleanly with the zeitgeist
- # server failing and being restarted; the Python client library will currently
- # just throw away messages to a dead server (as of 2011-05-12).
- zeitgeistclient = ZeitgeistClient()
use = {
"read" : Interpretation.ACCESS_EVENT,
"new" : Interpretation.CREATE_EVENT,
@@ -50,15 +46,15 @@ endfunction
python << endpython
import os
import time
+import dbus
import vim
try:
import gio
from zeitgeist.client import ZeitgeistClient
from zeitgeist.datamodel import Subject, Event, Interpretation, Manifestation
+ zeitgeistclient = ZeitgeistClient()
got_zeitgeist = True
-except RuntimeError, e:
- got_zeitgeist = False
-except ImportError, e:
+except (RuntimeError, ImportError, dbus.exceptions.DBusException):
got_zeitgeist = False
endpython
augroup zeitgeist