summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-04 13:30:32 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-04 13:30:32 +0200
commit60f21c0df4adaf3573e5e2f708a2237af83b458e (patch)
tree4a038d61177f30d141b861fdb11e43ea791687eb
parent1da74a9636e2b70457317a3c16387594977416fb (diff)
downloadpoezio-60f21c0df4adaf3573e5e2f708a2237af83b458e.tar.gz
poezio-60f21c0df4adaf3573e5e2f708a2237af83b458e.tar.bz2
poezio-60f21c0df4adaf3573e5e2f708a2237af83b458e.tar.xz
poezio-60f21c0df4adaf3573e5e2f708a2237af83b458e.zip
Factorise FIFO filename creation.
-rw-r--r--poezio/core/core.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index bea42f11..8356c025 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -761,14 +761,15 @@ class Core(object):
if config.get('exec_remote'):
# We just write the command in the fifo
fifo_path = config.get('remote_fifo_path')
+ filename = os.path.join(fifo_path, 'poezio.fifo')
if not self.remote_fifo:
try:
self.remote_fifo = Fifo(
- os.path.join(fifo_path, 'poezio.fifo'), 'w')
+ filename, 'w')
except (OSError, IOError) as exc:
log.error(
'Could not open the fifo for writing (%s)',
- os.path.join(fifo_path, './', 'poezio.fifo'),
+ filename,
exc_info=True)
self.information('Could not open the fifo '
'file for writing: %s' % exc, 'Error')
@@ -778,10 +779,10 @@ class Core(object):
command_str = ' '.join(args) + '\n'
try:
self.remote_fifo.write(command_str)
- except (IOError) as exc:
+ except IOError as exc:
log.error(
'Could not write in the fifo (%s): %s',
- os.path.join(fifo_path, './', 'poezio.fifo'),
+ filename,
repr(command),
exc_info=True)
self.information('Could not execute %s: %s' % (command, exc),