-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Engel <[email protected]>
- Loading branch information
Showing
6 changed files
with
21 additions
and
653 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,3 @@ | ||
# BlueChi Python bindings | ||
# hirte python bindings | ||
|
||
The BlueChi Python bindings provides a Python module to interact with the D-Bus API of BlueChi. It consists of the | ||
following subpackages: | ||
|
||
- `api`: auto-generated code based the BlueChi D-BUS API description | ||
- `ext`: custom written code to simplify common tasks | ||
|
||
## Installation | ||
|
||
Using `pip3`: | ||
|
||
```sh | ||
# from PyPi | ||
pip3 install bluechi | ||
# or from cloned git repo | ||
pip3 install --force dist/bluechi-<version>-py3-none-any.whl | ||
``` | ||
|
||
## Examples | ||
|
||
Listing all connected nodes and their current state: | ||
|
||
```python | ||
from bluechi.api import Manager | ||
|
||
for node in Manager().list_nodes(): | ||
# node[name, obj_path, status] | ||
print(f"Node: {node[0]}, State: {node[3]}") | ||
``` | ||
|
||
Starting and stopping of a systemd unit on a specific node using the `Unit` class from the `ext` subpackage to | ||
implicitly wait for the job to finish: | ||
|
||
```python | ||
from bluechi.ext import Unit | ||
|
||
hu = Unit("my-node-name") | ||
|
||
result = hu.start_unit("chronyd.service") | ||
print(result) | ||
|
||
result = hu.stop_unit("chronyd.service") | ||
print(result) | ||
``` | ||
The hirte python bindings are deprecated. Please use [bluechi](https://pypi.org/project/bluechi/) instead. |
Oops, something went wrong.