From 3a42c7d4250962311241b92c7f3184e14b29c270 Mon Sep 17 00:00:00 2001 From: Young Date: Wed, 15 Jul 2020 12:17:18 +0000 Subject: [PATCH] normal update --- README.md | 8 ++++++++ docs/RoadMap.md | 4 ++-- wan/__init__.py | 3 ++- wan/utils.py | 1 - 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5c6636e..6f5bbd3 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,15 @@ log_level: DEBUG # the default level is INFO # Usage ## Use in python code + +* Call the function in python code directly. ```python from wan import ntf; ntf('Finished') ``` + +* Call the function in shell directly +```shell +> sleep 10 ; wan ntf sleep finished +``` + diff --git a/docs/RoadMap.md b/docs/RoadMap.md index 14bd555..049ae04 100644 --- a/docs/RoadMap.md +++ b/docs/RoadMap.md @@ -1,13 +1,13 @@ # Plan - - ## Development - [ ] Start command after another process ends or become idle - [ ] Draw the workflow. - [ ] auto find my running process - [ ] Run and wait the command +- [ ] GIF to demonstrate the usage of WAN - [ ] documents(rst??) +- [ ] Opensource Licence? - [ ] travies - CI diff --git a/wan/__init__.py b/wan/__init__.py index 4223e44..c93d8df 100644 --- a/wan/__init__.py +++ b/wan/__init__.py @@ -43,7 +43,8 @@ def __init__(self, config_path: str = '~/.dotfiles/.notifers.yaml'): kwargs = self.config['kwargs'] self._ntf = partial(self._provider.notify, **kwargs) - def ntf(self, message): + def ntf(self, *messages): + message = " ".join(messages) logger.debug("Sending message: {}".format(message)) self._ntf(message=message) diff --git a/wan/utils.py b/wan/utils.py index 6d4209d..43e4477 100644 --- a/wan/utils.py +++ b/wan/utils.py @@ -14,7 +14,6 @@ def get_pid_from_line(line): def get_pid_via_fzf(exact=True): - # TODO: make it can be selected with full match return get_pid_from_line(iterfzf(iter_ps(), multi=False, exact=exact))