|
|
@ -2,6 +2,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
It gets a notification from a server and notifies the user.
|
|
|
|
It gets a notification from a server and notifies the user.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Ecosystem
|
|
|
|
|
|
|
|
- [notification-server](https://gitlab.com/KKlochko/notification-server)
|
|
|
|
|
|
|
|
- [notification-producer](https://gitlab.com/KKlochko/notification-producer)
|
|
|
|
|
|
|
|
- [notification-client](https://gitlab.com/KKlochko/notification-client) (current)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Setup [notification-server](https://gitlab.com/KKlochko/notification-server), before continue.
|
|
|
|
|
|
|
|
- Clone this repository.
|
|
|
|
|
|
|
|
- Ensure that python and pip are installed:
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
python --version
|
|
|
|
|
|
|
|
python -m pip -V
|
|
|
|
|
|
|
|
# or
|
|
|
|
|
|
|
|
python3 --version
|
|
|
|
|
|
|
|
python3 -m pip -V
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Create a virtual environment if needed:
|
|
|
|
|
|
|
|
Using `virtualenv`:
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
virtualenv .venv
|
|
|
|
|
|
|
|
. .venv/bin/activate
|
|
|
|
|
|
|
|
# or
|
|
|
|
|
|
|
|
virtualenv3 .venv
|
|
|
|
|
|
|
|
. .venv/bin/activate
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Using `poetry`:
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
poetry shell
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Install the dependencies:
|
|
|
|
|
|
|
|
Using `pip`:
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
|
|
# or
|
|
|
|
|
|
|
|
pip3 install -r requirements.txt
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Using `poetry`:
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
poetry install
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Run the main file:
|
|
|
|
|
|
|
|
Use options ip and port to change the server address. 127.0.0.1:5555 is the default address.
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
python -m notification_client.main --help
|
|
|
|
|
|
|
|
# or
|
|
|
|
|
|
|
|
python3 -m notification_client.main --help
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Commands
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Connect to the server:
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
python -m notification_client.main
|
|
|
|
|
|
|
|
python -m notification_client.main --ip 0.0.0.0 --port 4000
|
|
|
|
|
|
|
|
# or
|
|
|
|
|
|
|
|
python3 -m notification_client.main
|
|
|
|
|
|
|
|
python3 -m notification_client.main --ip 0.0.0.0 --port 4000
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Exit:
|
|
|
|
|
|
|
|
`Ctlr + C` (`C-c`).
|
|
|
|
|
|
|
|
|
|
|
|
# Author
|
|
|
|
# Author
|
|
|
|
|
|
|
|
|
|
|
|
Kostiantyn Klochko (c) 2023
|
|
|
|
Kostiantyn Klochko (c) 2023
|
|
|
|