This commit is contained in:
Daniel Langbein 2021-07-22 17:11:23 +02:00
parent 632566b27c
commit a5ca35dbde
3 changed files with 14 additions and 4 deletions

View File

@ -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`.

View File

@ -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

View File

@ -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