673da6312b
Add --token parameter to easyinstall.sh Add --skip-token parameter to easyinstall.sh Install required apt packages explicitly (--no-install-recommends) Allow standalone RaSCSI and web UI installations to specify an auth token Add development mode to web UI (web/start.sh --dev-mode) Initial Docker-based development environment for Python and web UI Bump protobuf version Workaround for Flask development server and asyncio incompatibility Build Python protobuf interface on container launch, if it doesn’t exist Allow containers to be configured with environment variables, add support for token authentication Move web UI live editing setup out of main Docker Compose config Update dockerignore to exclude by default Update README Add OS_DISTRO, OS_VERSION and OS_ARCH build args Allow extracted files to be moved to target when crossing a filesystem boundary Reduce noise from watchmedo auto-restarts Update Docker tag structure to rascsi:{build}-{platform}-{variant} Prevent Docker Compose from attempting to pull images from Docker registry Add workaround for issue #821 Allow container processes to be stopped with Ctrl+C Update README, bind to ports 8080/8443 on the Docker host by default Update README to clarify audience and no board connectivity Add AIBOM and GAMERNIUM to --connect_type validation Update cfilesystem.patch following rebase |
||
---|---|---|
.. | ||
rascsi | ||
util | ||
__init__.py | ||
README.md |
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.