Sunday, September 21, 2014

Announcing Morris 1.0

Earlier today I've released the first standalone version of Morris (source, documentation). Morris is named after Gabriel Morris, the inventor of Colonne Morris aka the advertisement column. Morris is a simple and proven Python event/signaling library (not for watching sockets or for doing IO but for generic, in-process broadcast messages).

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

Thursday, September 4, 2014

PEX, distribute your standalone python executables

I just discovered PEX. It's pretty simple conceptually. Bundle all your python 2/3 modules in a ZIP file. Add a __main__.py inside with bootstrap magic and set the interpreter to #!/usr/bin/env python* and you're done. That's what PEX does for you, with a few extra bells and whistles.

So I did this:

$ pex -r 'plainbox' -r 'xlsxwriter' -r 'lxml' \
  -e plainbox.public:main -o plainbox

And it worked :-) It's super simple and quite convenient for many things I can think of. If you want to play around with the python3 version you may want to apply this patch (python3 is still a stranger to many developers :P)

You can also download the resulting PlainBox executable

Tuesday, September 2, 2014

Personal annoyance personified: we need a Serial Manager

This is a personal annoyance of mine. Everything involving a serial line is preceded by "sudo stop modemmanager". Given that we're talking about a free desktop things should not have to require that.

I've just noticed and read the "Ubuntu Loves Devs" effort and I think that's something that could be addressed, or at least acknowledged. I've filed a bug report about what could be made to make modems and embedded / specialized development tools be less at odds with each other.

If you're interested in embedded development boards or accessing various devices using serial lines I'd like to invite you to join the discussion.