mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-05 00:04:46 +00:00
ddeede2beb
Summary ov most important changes triggered by the SASI code removal: - Removed the SASI controller code - New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests. - New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests. - The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes. - The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI. - scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device - Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling. - Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers. - Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::. - Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic. - Use constructor member initialization lists (recommended for ISO C++) - Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling - Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow) - Replaced NULL by nullptr (recommended for C++), resulting in better type safety - Use more const member functions in order to avoid side effects - The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs. - Better encapsulation, updated access specifiers in many places - Removed unused methods and method arguments - Fixed a number of TODOs - Added/updated unit tests for a lot of non-legacy classes - Makefile support for creating HTML coverage reports with lcov/genhtml |
||
---|---|---|
.. | ||
common | ||
ctrlboard | ||
loopback_test | ||
oled | ||
web | ||
__init__.py | ||
.pylintrc | ||
README.md |
RaSCSI Reloaded Python Apps
This directory contains Python-based clients for RaSCSI Reloaded as well as common packages that are shared among the clients.
The following paragraphs in this README contain instructions that are shared among all Python apps.
Supported Python interpreter
The policy in this project is to support the Python 3 interpreter that comes standard with the current stable, as well as previous stable release of Debian.
At the time of writing they are:
- Python 3.9.2 in Debian Bullseye
- Python 3.7.3 in Debian Buster
Static analysis with pylint
It is recommended to run pylint against new code to protect against bugs and keep the code readable and maintainable. The local pylint configuration lives in .pylintrc. In order for pylint to recognize venv libraries, the pylint-venv package is required.
sudo apt install pylint3
sudo pip install pylint-venv
source venv/bin/activate
pylint3 python_source_file.py
Examples:
# check a single file
pylint web/src/web.py
# check the python modules
pylint common/src
pylint web/src
pylint oled/src