From 6653e49a6228d2a8ce21a0d4f3d3bcc9d5b13560 Mon Sep 17 00:00:00 2001 From: Oliver Schmidhauser Date: Mon, 30 Apr 2018 12:04:22 +0200 Subject: [PATCH] remove notification in case mpd goes away --- termuxmpdnotifications/__main__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/termuxmpdnotifications/__main__.py b/termuxmpdnotifications/__main__.py index 25c9e0b..1efdf11 100644 --- a/termuxmpdnotifications/__main__.py +++ b/termuxmpdnotifications/__main__.py @@ -49,8 +49,10 @@ def __init__(self,args): self.client.idle() except mpd.ConnectionError: self.err("Connection Aborted.") + self.removeNotification() except ConnectionRefusedError: self.err("Connection Refused.") + self.removeNotification() def err(self,out): print(out,file=sys.stderr) def removeNotification(self):