Skip to content

Commit

Permalink
updated demos to use priority
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Berenz committed Nov 17, 2022
1 parent d43c2bf commit da5750e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore=
E501,
E203,
W503
6 changes: 3 additions & 3 deletions demos/ntfy_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -68,15 +68,15 @@ def _configure_log(logfile: Path) -> None:
level2email=level2email,
)

## other handlers ##
# other handlers #

# printing to terminal
stream_handler = logging.StreamHandler()

# 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]
Expand Down
2 changes: 2 additions & 0 deletions demos/ntfy_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit da5750e

Please sign in to comment.