Skip to main content

Events for Morepath

Project description

more.signals is an extension for Morepath that adds Blinker signals support.

Quickstart

The integration adds two directives to a Morepath App for connecting and disconnecting signals. Once connected you can emit to signal using request.app.signal('signal.name') to specify a named signal and then use the send() method, or you can combine both using request.app.signal('signal.name').send(self, **data). Please read Blinker’s documentation for all the details.

from more.signals import SignalApp

class App(SignalApp):
    pass


@App.connect('hello')
def say_hello(sender, **data):
    print('HELLO {}!'.format(data.get('name')))


@App.path(path='')
class Root(object):
    pass


@App.json(model=Root)
def root_view(self, request):
    name = 'Foo Bar'
    request.app.signal('hello').send(self, name=name)
    return {'name': name}


if __name__ == '__main__':
    morepath.run(App())

CHANGES

0.1.0 (2017-01-29)

  • Initial public release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for more.signals, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size more.signals-0.1.0-py3-none-any.whl (5.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size more.signals-0.1.0.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

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