Skip to main content

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

example

Pyrulo-qt uses propsettings-qt to render the object if it has propsettings's Settings registered.

Project details


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.6.tar.gz (7.4 kB view hashes)

Uploaded source

Built Distribution

pyrulo_qt-0.3.6-py3-none-any.whl (8.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page