summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-02-07 09:24:51 +0200
committerLars Wirzenius <liw@liw.fi>2021-02-07 10:31:39 +0200
commitd536150cc444239dce255eff9e81072197c53cf7 (patch)
tree85eb0e18ec82526df1b7cebc8fc0d0643e36f0be /share
parent6b82498a88d0cade19d5fb5da4536ec79e20bd55 (diff)
downloadsubplot-d536150cc444239dce255eff9e81072197c53cf7.tar.gz
refactor(lib/daemon.py): reformat with Black
I don't know how this passed ./check previously. I might not have had Black installed, maybe. Anyway, fixed now.
Diffstat (limited to 'share')
-rw-r--r--share/python/lib/daemon.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/share/python/lib/daemon.py b/share/python/lib/daemon.py
index d436b4f..11f65bf 100644
--- a/share/python/lib/daemon.py
+++ b/share/python/lib/daemon.py
@@ -140,13 +140,17 @@ def daemon_wait_for_port(host, port, timeout=5.0):
s.close()
return
except socket.timeout:
- logging.error(f"daemon did not respond at port {port} within {timeout} seconds")
+ logging.error(
+ f"daemon did not respond at port {port} within {timeout} seconds"
+ )
raise
except socket.error as e:
logging.info(f"could not connect to daemon at {port}: {e}")
pass
if time.time() >= until:
- logging.error(f"could not connect to daemon at {port} within {timeout} seconds")
+ logging.error(
+ f"could not connect to daemon at {port} within {timeout} seconds"
+ )
raise ConnectionRefusedError()
# Sleep a bit to avoid consuming too much CPU while busy-waiting.
time.sleep(0.1)
@@ -198,7 +202,9 @@ def daemon_process_exists(ctx, args=None):
def _daemon_pgrep(pattern):
logging.info(f"checking if process exists: pattern={pattern}")
- exit = subprocess.call(["pgrep", "-laf", pattern], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ exit = subprocess.call(
+ ["pgrep", "-laf", pattern], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
+ )
logging.info(f"exit code: {exit}")
return exit == 0