Pyrulo-qt
Qt widgets to load classes at runtime with pyrulo python package.
Installation
pip install pyrulo-qt
Usage
Lets say we have the following scripts
# base.py script
class Base:
pass
# a.py script
from base import Base
class A(Base):
def __init__(self):
self._a = 42
def __str__(self):
return "A"
# b.py script
from base import Base
class B(Base):
def __init__(self):
self._b = "dwqwdqw"
def __str__(self):
return "B"
# c.py script
from base import Base
class C(Base):
def __init__(self):
self._c = 0.2
self._d = None
def __str__(self):
return "C"
ConfigurableSelector Qt widget can be used to select from the child classes of a base class and return an instance of the selected class.
from base import Base
from pyrulo import class_imports
from pyrulo_qt.ui_configurable_selector import ConfigurableSelector
folder_dir = "."
class_imports.import_classes_in_dir(folder_dir, Base) # first import the classes with pyrulo
selector = ConfigurableSelector(base_class=Base) # Qt widget to select the child classes
The resulting widget looks like this
Pyrulo-qt uses propsettings-qt to render the object if it has propsettings's Settings registered.
Metadata
Release files for pyrulo-qt 0.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrulo-qt-0.3.6.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrulo_qt-0.3.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / pyrulo-qt-0.3.6.tar.gz
| Download URL | pyrulo-qt-0.3.6.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e248f93bc1b3644d466bfeca96c66f84a8b3eb5c01790deb54100a47552e13e7
|
|
BLAKE2b-256 checksum How to use checksums |
c3c4a38b69dbd2b6767806a4ada72a308474d8f9743dd647756c4e489c93202d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / pyrulo_qt-0.3.6-py3-none-any.whl
| Download URL | pyrulo_qt-0.3.6-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b902456f3b1b8a5fb3914a62d357ff82acf77d34b5907411bb2aa3b3191b49c
|
|
BLAKE2b-256 checksum How to use checksums |
8e20b7a7d95312c6ed62b711ab83daee695817da8cef0978295b48db0cc4baad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|