Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #4

Merged
merged 11 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
normal update
  • Loading branch information
you-n-g committed Jul 15, 2020
commit 3a42c7d4250962311241b92c7f3184e14b29c270
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<Your code which takes a lot of time>
from wan import ntf; ntf('Finished')
```

* Call the function in shell directly
```shell
> sleep 10 ; wan ntf sleep finished
```

4 changes: 2 additions & 2 deletions docs/RoadMap.md
Original file line number Diff line number Diff line change
@@ -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


Expand Down
3 changes: 2 additions & 1 deletion wan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion wan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down