Morris is the first part of the Plainbox project that I've released as a standalone, small library. We've been using that code for two years now. Morris is simple, well-defined and I'd dare to say, complete. Hence the 1.0 version, unlike the traditional 0.1 that many free software projects start with.
Morris works on python 2.7+ , pypy and python 3.2+. It comes with tests, examples and extensive docstrings. Currently you can install it from pypi but a Debian package is in the works and should be ready for review later today.
Here's a simple example on how to use the library in practice:
from __future__ import print_function
from morris import signal
class Processor(object):
def process(self, thing):
self.on_processing(thing)
@signal
def on_processing(self, thing):
pass
def on_processing(thing):
print("Processing {}".format(thing))
proc = Processor()
proc.on_processing.connect(on_processing)
proc.process("foo")
proc.process("bar")
For more information check out morris.readthedocs.org
No comments:
Post a Comment