This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

panglery is a library for writing hooks for events in python.

Here’s a basic example of usage:

import panglery
p = panglery.Pangler()

@p.subscribe(event='example', needs=['spam'])
def example_hook(p, spam):
    print spam

p.trigger(event='example', spam='eggs')
# prints 'eggs'

And a little bit more involved:

@p.subscribe(needs=['spam'], returns=['spam'])
def modify_spam_hook(p, spam):
    spam = spam + ' spam'
    return {'spam': spam}

p.trigger(event='example', spam='eggs')
# prints 'eggs spam'

Hooks can also add parameters to an event which then trigger other hooks:

p = panglery.Pangler()

@p.subscribe(needs=['spam'], returns=['eggs'])
def make_eggs_hook(p, spam):
    eggs = spam + ' eggs'
    return {'eggs': eggs}

@p.subscribe(event='example', needs=['eggs']):
def eggs_hook(p, eggs):
    print eggs

p.trigger(event='example', spam='eggs')
# prints 'eggs eggs'

PanglerAggregates can be used to aggregate together multiple Panglers across all superclasses:

class ExampleBase(object):
    p = panglery.PanglerAggregate('hooks')
    hooks = panglery.Pangler()

    @hooks.subscribe(event='example')
    def example_hook_base(self, p):
        print 'spam'

class ExampleDerived(ExampleBase):
    hooks = panglery.Pangler()

    @hooks.subscribe(event='example')
    def example_hook_derived(self, p):
        print 'eggs'

inst = ExampleDerived()
inst.p().trigger(event='example')
# prints 'spam' and 'eggs' in some order.
Release History

Release History

1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
panglery-1.tar.gz (5.9 kB) Copy SHA256 Checksum SHA256 Source Mar 28, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting