From da5750eed1ed58eacf4ff1bb1498586b41242f70 Mon Sep 17 00:00:00 2001 From: Vincent Berenz Date: Thu, 17 Nov 2022 15:40:29 +0100 Subject: [PATCH] updated demos to use priority --- .flake8 | 5 +++++ demos/ntfy_logging.py | 6 +++--- demos/ntfy_push.py | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..2342169 --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +[flake8] +ignore= + E501, + E203, + W503 diff --git a/demos/ntfy_logging.py b/demos/ntfy_logging.py index 797b31e..8401a98 100644 --- a/demos/ntfy_logging.py +++ b/demos/ntfy_logging.py @@ -27,7 +27,7 @@ def _configure_log(logfile: Path) -> None: printed to logfile, and sent as ntfy notification. """ - ## configuration for the ntfy handler ## + # configuration for the ntfy handler # # tags associated to the logging level level2tags = { @@ -68,7 +68,7 @@ def _configure_log(logfile: Path) -> None: level2email=level2email, ) - ## other handlers ## + # other handlers # # printing to terminal stream_handler = logging.StreamHandler() @@ -76,7 +76,7 @@ def _configure_log(logfile: Path) -> None: # printing to file file_handler = logging.FileHandler(logfile) - ## setting up logs ## + # setting up logs # handlers: typing.Optional[typing.Iterable[logging.Handler]] handlers = [stream_handler, file_handler, ntfy_handler] diff --git a/demos/ntfy_push.py b/demos/ntfy_push.py index 35a0937..f849b7a 100644 --- a/demos/ntfy_push.py +++ b/demos/ntfy_push.py @@ -14,9 +14,11 @@ def run(): # as the icon example from the ntfy documentation also do not work # basic usage, most arguments are optional + # priority possibles values: MAX, HIGH, DEFAULT, LOW, MIN ntfy.push( topic, "ntfy_lite demo 1 - basic usage", + priority=ntfy.Priority.DEFAULT, message="this is a demo from ntfy_lite", tags=["butterfly", "cat"], icon="https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png",