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.5.tar.gz
(6.7 kB
view details)
Built Distribution
File details
Details for the file pyrulo-qt-0.3.5.tar.gz
.
File metadata
- Download URL: pyrulo-qt-0.3.5.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca168b7ef39dd103d49a2f6ecb6a9dc8b055e78001189e6320194ce106d75d6e |
|
MD5 | a378550fad09dd24cd0cd14b34caf940 |
|
BLAKE2b-256 | 9e2f9b77de14ffbbb965dbe1d0bdbf243df05d35cdf41a170d5a02a704663649 |
File details
Details for the file pyrulo_qt-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: pyrulo_qt-0.3.5-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccf8997cae7588663f4bcccec19b4983916ff0bc1b2104a171cecf7f255e131f |
|
MD5 | 3bb302d096c916734f5e5054e17826d2 |
|
BLAKE2b-256 | b3ba3235f1c61095612adb720fff0f00fc02ab58d3be3f53835525ee9122eab8 |