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
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.3.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file pyrulo-qt-0.3.3.tar.gz
.
File metadata
- Download URL: pyrulo-qt-0.3.3.tar.gz
- Upload date:
- Size: 6.3 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 | 6178fb8b52c4a454bd49035277f00ffe0ced4d5617c47d31f412231ce9b73ce5 |
|
MD5 | 318deff2f8d738cfc694162cb6590444 |
|
BLAKE2b-256 | 06a9cfde1ec0dcf9e3400cbdf07df94bd87e3e34a4088a6255e89bcb482592ab |
File details
Details for the file pyrulo_qt-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: pyrulo_qt-0.3.3-py3-none-any.whl
- Upload date:
- Size: 7.0 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 | a21269ca1eecf7fd080aff2bb5fba305536991d94ee4e8f3bd92b6e8923547fa |
|
MD5 | d2424cea8ce0b09b0c5be117a7865cc3 |
|
BLAKE2b-256 | ba3e6851ec260a41f3edad333665c67686bd8b43dd1c357b43525d59964d2474 |