OPI generation for CS-Studio and Phoebus
This repository is forked from dls-controls/cssgen, and renamed to opi-generator, with the package name of opigen.
After a thorough refactoring process, opigen now supports OPI files generation for both CS-Studio and Phoebus from the same script, which minimizes the effort required to maintain both platforms, making it more efficient and streamlined.
Installation
pip install opigen
Attribute Mapping
opigen can generate OPI files that are compatible with both CS-Studio and Phoebus by utilizing the concept of "attribute mapping". Essentially, this involves ensuring that each attribute of a widget class in CS-Studio has a corresponding counterpart in Phoebus. By accurately mapping the attribute names, opigen can seamlessly handle both systems with the same code. This approach not only simplifies the development process but also ensures cross-compatibility, making it easier for developers to create robust and adaptable OPI files that can be used across different platforms.
The command line tool opigen-export_attr_map could be used to export
the attribute map from CS-Studio (.opi) to Phoebus (.bob) that are in-use.
The exported file contains an attribute map from CS-Studio (.opi) to Phoebus (.bob).
The attribute name must be mapped for Phoebus, otherwise it will be missing in the generated file.
Let's assume an use-case that bitReverse attribute of the class Byte (refers to
ByteMonitor) needs to be correctly handled
on both, but the system deployed attribute map does not provide it, the use will
have to extend it. To extend or update it, follow these steps:
- Create a file named
attr.tomlin the current working directory. - Create a new section with the widget class name, e.g.
[Byte]. - Add new attribute maps or override existing ones under the new section,
e.g.
bitReverse = "bitReverse". - If there is no
attr.tomlin the current working directory, use the one in the user home directory at~/.opigen/attr.tomlto do the extend or override if possible. - If
attr.tomlexists in both places, the one in the current working directory takes precedence.
Global Formatting
opigen provides global formatting options through opigen/config/color.def and opigen/config/font.def.
The module searches for *.def in the following order:
cwd/*.def~/.opigen/*.def<opigen-package-dir>/config/*.def
Development
- Formatter:
yapf
Metadata
Release files for opigen 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opigen-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for opigen-1.1.0-py3-none-any.whl |
Release files / opigen-1.1.0-py3-none-any.whl
| Download URL | opigen-1.1.0-py3-none-any.whl |
|---|---|
| Size | 57.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60063a0f5c9f76ebffbf38ad4396a44d7159351fb45c7b770ec164f955448502
|
|
BLAKE2b-256 checksum How to use checksums |
42acaba2bd29f635d33c672240ff1db3a5e954b6758b0fdd34df7c78e515ce89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.20
|
Security for opigen 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.