Reflex is an event system for applications made using Python.
The package provides a way for applications to manage events and event listeners, with little effort.
While the system is somewhat more complex than existing event systems, I feel it is more flexible, and more powerful.
Below is an example that hints at the capabilites of Reflex:
from reflex.data import Event
from reflex.control import EventManager
from reflex.interfaces import Reactor
class example(Reactor):
name = 'example'
def __inst__(self):
self.bind(self.handler, 'basic', source='main')
self.bind(self.use_args, 'args')
def handler(self, event, *args):
print("Hello, world!")
def use_args(self, event, *args):
print("Event triggered by {0} since because {1}.".format(event.source, args[0]))
events = EventManager()
obj = example(events)
# The following event trigger is not handled by anything.
events.trigger(Event('basic'))
# The next event trigger is handled by the handler method.
events.trigger(Event('basic', [('source', 'main')]))
# This one is yes.
events.trigger(Event('args', [('source', 'main')]), 'pickles')
Documentation and a package reference can be found at http://photofroggy.github.com/Reflex/index.html
The purpose of this package is to make creating an event driven plugin system for your application an effortless task. A full plugin system can created in just a few lines, as shown here:
from reflex.data import Event
from reflex.control import EventManager
from reflex.control import ReactorBattery
import plugins
# Create an event manager.
events = EventManager()
# Create a battery.
battery = ReactorBattery()
# Load our plugins.
battery.load_objects(events, plugins, 'Plugin')
# Plugins can now be accessed as such:
# battery.loaded[plugin_name]
# Events can be fired as follows:
# events.trigger(Event('my event'))
# Easy as pie!
The above example assumes your plugins are stored in a package called plugins.
Metadata
Release files for Reflex-events 1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| Reflex-events-1.14.zip | 26.8 kB | Without provenance | Details | |
| Reflex-events-1.14.tar.gz | 17.4 kB | Without provenance | Details |
Release files / Reflex-events-1.14.zip
| Download URL | Reflex-events-1.14.zip |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75a8d4f618ab34eaa0b62dd74161d210f9aba1dc012219f166178dd4f2e4752e
|
|
BLAKE2b-256 checksum How to use checksums |
e3b6b336104944d55662f19dec6bb5ebc69c0eff6ba278548ac0708cbe8b2ba6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Reflex-events-1.14.tar.gz
| Download URL | Reflex-events-1.14.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d726d659db877c33bb8515fb995b4514ac3bd7394792465b7dd48b4d3a62496b
|
|
BLAKE2b-256 checksum How to use checksums |
3e64efbce61dcaac85e3a56ad9d411a7bfb0b3c7ade1b3247afb7df6c0a4e687
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Reflex-events 1.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.