fix regressions in alfred.py
This commit is contained in:
parent
6fba8ad21b
commit
90ab26d50b
|
@ -8,17 +8,15 @@ class Alfred(object):
|
||||||
Bindings for the alfred-json utility
|
Bindings for the alfred-json utility
|
||||||
"""
|
"""
|
||||||
def __init__(self, unix_sockpath=None):
|
def __init__(self, unix_sockpath=None):
|
||||||
if unix_sockpath:
|
self.unix_sock = unix_sockpath
|
||||||
if os.path.exists(unix_sockpath):
|
if unix_sockpath is not None and not os.path.exists(unix_sockpath):
|
||||||
self.unix_sock = unix_sockpath
|
raise RuntimeError('alfred: invalid unix socket path given')
|
||||||
else:
|
|
||||||
raise RuntimeError('alfred: invalid unix socket path given')
|
|
||||||
|
|
||||||
def _fetch(self, data_type):
|
def _fetch(self, data_type):
|
||||||
cmd = ['alfred-json',
|
cmd = ['alfred-json',
|
||||||
'-z',
|
'-z',
|
||||||
'-f', 'json',
|
'-f', 'json',
|
||||||
'-r', data_type]
|
'-r', str(data_type)]
|
||||||
if self.unix_sock:
|
if self.unix_sock:
|
||||||
cmd.extend(['-s', self.unix_sock])
|
cmd.extend(['-s', self.unix_sock])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue