RASCSI/python/common/src
Daniel Markstedt 85edd50047
Partition and format HFS/FAT volumes in the Web UI + SMB install (#946)
- New "format as" option when creating new images; removing the image creation options from easyinstall
- Bring in HFSer as new submodule providing the driver binaries; removing the Lido driver binary from this repo
- Add SpeedTools driver option
- Point to github mirror of hfdisk, since the original git server is down
- While rearranging the easyinstall options, moved the CtrlBoard option up to the main section
- Add an easyinstall script to configure Samba, while consolidating file sharing with Netatalk
2022-11-01 16:43:24 -07:00
..
rascsi Partition and format HFS/FAT volumes in the Web UI + SMB install (#946) 2022-11-01 16:43:24 -07:00
util More refactoring of Python code to address Sonar issues (#906) 2022-10-12 12:59:01 -07:00
__init__.py restructuring towards python client library #455 (#613) 2022-01-21 15:08:29 -08:00
README.md restructuring towards python client library #455 (#613) 2022-01-21 15:08:29 -08:00

RaSCSI Common Python Module

The common module contains python modules that are shared among multiple Python applications such as the OLED or the Web application. It contains shared functionality. For example, the rascsi python module provides functionality for accessing rascsi through its protobuf interface and provides convenient classes for that purpose.

Usage

To make use of the rascsi python module, it needs to be found by the Python scripts using it. This can be achieved in multiple ways. One way is to simply adapt the PYTHONPATH environment variable to include the common/src directory:

PYTHON_COMMON_PATH=${path_to_common_directory}/common/src
export PYTHONPATH=$PWD:${PYTHON_COMMON_PATH}
python3 myapp.py

The most interesting functions are likely found in the classes RaCtlCmds and FileCmds. Classes can be instantiated, for example, as follows (assuming that rascsi host, rascsi port and token are somehow retrieved from a command line argument):

sock_cmd = SocketCmds(host=args.rascsi_host, port=args.rascsi_port)
ractl_cmd = RaCtlCmds(sock_cmd=sock_cmd, token=args.token)

Usage examples can be found in the existing RaSCSI Python applications.