From a5ca35dbdeeace9398e3cc2b7af63b4248b11720 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 22 Jul 2021 17:11:23 +0200 Subject: [PATCH] v0.1.1 --- README.md | 10 ++++++++-- setup.cfg | 2 +- src/de/p1st/exec_notify/lib/mail.py | 6 +++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c996618..9ae815d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ * Send email notification if command fails with [de-p1st-execNotify](src/de/p1st/exec_notify/execNotify.py). * Send unconditional notifications with [de-p1st-notify](src/de/p1st/exec_notify/notify.py). -## Installation +## Installation - venv More detailed instructions about _venv_ can be found at [https://docs.python.org/3/library/venv.html](https://docs.python.org/3/library/venv.html) @@ -23,7 +23,7 @@ source ~/execNotify/venv/bin/activate Option A: Install the module from TestPyPI: ```shell -python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --upgrade de-p1st-execNotify +python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --upgrade de.p1st.exec-notify ``` The above command uses the parameter `--no-deps`: @@ -45,6 +45,12 @@ python3 -m pip install ~/Downloads/git/execNotify/ pip list ``` +## Instalation - global + +```shell +sudo python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --upgrade de.p1st.exec-notify +``` + ## Configuration Create configuration file `/etc/execNotify/cfg.ini`. diff --git a/setup.cfg b/setup.cfg index 6f2762b..7f9d387 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ [metadata] name = de.p1st.exec_notify -version = 0.1.0 +version = 0.1.1 author = Daniel Langbein author_email = daniel@systemli.org description = Send mail with process output diff --git a/src/de/p1st/exec_notify/lib/mail.py b/src/de/p1st/exec_notify/lib/mail.py index 1840fd4..e7044c5 100644 --- a/src/de/p1st/exec_notify/lib/mail.py +++ b/src/de/p1st/exec_notify/lib/mail.py @@ -76,4 +76,8 @@ def localMailExists(): """ :return: True if local mail exists in maildir folder. Once the mail is read the user shall delete (or move) it. """ - return len(list(config.getMailDir().iterdir())) > 0 + mailDir = config.getMailDir() + if not mailDir.exists(): + return False + else: + return len(list(mailDir.iterdir())) > 0