Merge pull request #185 from phidebian/phi-rem-conn
Exit remotinator with an explicit error message when terminator is needed but not running
This commit is contained in:
commit
527a8df76c
|
@ -2,6 +2,7 @@
|
||||||
# GPL v2 only
|
# GPL v2 only
|
||||||
"""ipc.py - DBus server and API calls"""
|
"""ipc.py - DBus server and API calls"""
|
||||||
|
|
||||||
|
import sys
|
||||||
import hashlib
|
import hashlib
|
||||||
from gi.repository import Gdk
|
from gi.repository import Gdk
|
||||||
import dbus.service
|
import dbus.service
|
||||||
|
@ -194,7 +195,14 @@ def with_proxy(func):
|
||||||
dbg('dbus client call: %s' % func.__name__)
|
dbg('dbus client call: %s' % func.__name__)
|
||||||
def _exec(*args, **argd):
|
def _exec(*args, **argd):
|
||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
|
try:
|
||||||
proxy = bus.get_object(BUS_NAME, BUS_PATH)
|
proxy = bus.get_object(BUS_NAME, BUS_PATH)
|
||||||
|
|
||||||
|
except dbus.DBusException as e:
|
||||||
|
sys.exit(
|
||||||
|
"Remotinator can't connect to terminator. " +
|
||||||
|
"May be terminator is not running.")
|
||||||
|
|
||||||
func(proxy, *args, **argd)
|
func(proxy, *args, **argd)
|
||||||
return _exec
|
return _exec
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue