Qt widgets to use runtime loading features from pyrulo package
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyrulo-qt-0.3.4.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file pyrulo-qt-0.3.4.tar.gz
.
File metadata
- Download URL: pyrulo-qt-0.3.4.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f129befdcb1da8c5f5dbf9a1487d3ff535524234c3e2b4dcf56c1a216807d760 |
|
MD5 | 240af6cc5f4e0302ce434aec92c61ae1 |
|
BLAKE2b-256 | 0541f7239257aa1bb052f41b0539a734d7495424b00b8fd69b0034966cc6caad |
File details
Details for the file pyrulo_qt-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: pyrulo_qt-0.3.4-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2eeb81bea927a45355d87b351fd0557f55301f0728f9f4797880047e1d90afa |
|
MD5 | 6c30eacbf7e3b8951cf44ea446fdbb38 |
|
BLAKE2b-256 | 70027a786f456d4a9683838372ebb938972742f22e15e4f652640375ff2bf324 |