circuits-2.1.0 is out

I’m pleased to announce the release of circuits 2.1.0

This is a minor release which includes some new features and bug fixes. Some of the highlights of this release include:

  • Python 3 support.
  • Windows support.
  • PyPy support.
  • IPv6 support.
  • Better WSGI support.
  • Fully documented examples.
  • Component Interface querying.

For more information see the PyPi page:

Random Password Generator

I’ve been seeing a lot of this lately on ActiveState Code Recipes; Random Password Generators written in Python. Well I thought I’d get in on this and share one I’ve been using for many years, but mostly because I’m finding “Blogging” to be quite fun! This recipe is also a part of my very old pymills repository of useful modules and routines I’ve either written or collected. You might find bits and pieces of my library useful. [Read More]

Unpacking and Conditional Expressions

Unpacking tuples and conditional expressions in Python.

The other day whilst working on a web crawler at work called spyda I came across an interesting behavior in Python. Here it goes: >>> xs = [(1, 2), (3, 4)] >>> a, b = xs[0] if xs else None, None >>> a (1, 2) >>> b Notice that a becomes the first tuple in the list and b becomes None? This kinda got me stumped at first until I realized what was happening with the Python parser. [Read More]

Introducing the circuits team

Lately circuits has seen some presence in the wild and this is a good thing for the project. Just the other day posted a job advert on the Python Job Board in need of a RESTful Web Developer to designer and build their public API(s). Naturally I sent them an email asking if they’d like to hire the lead developer of circuits (that’s me!) :) I thought it was about time I setup a circuits team repository on bitbucket to make things a little more prominent. [Read More]

Python Websockets Server with Circuits

Today marks the release of circuits-1.5 which brings to the circuits application framework a new circuits.web dispatcher. The WebSockets dispatcher This dispatcher allows you to build a web application that is capable of accepting WebSockets client connections on the same process/thread. Using circuits-1.5 here is a very simple Web Application that has WebSockets support and echos back every message it recieves: index.html: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. [Read More]

Worker Pools with Circuits

For some time now I’ve been wanting to greatly improve the concurrency support in circuits and implement worker pools (using threads and/or processes). A few weeks ago I finally did that. I thought it would be hard at first until it hit me; circuits has all the tools necessary It turns out implementing “worker pools” in circuits is quite simple. All you need to do is construct a component that will start a number of other components as workers (either in thread mode or process mode). [Read More]

Vmware Tools with 64bit Linux Guest

New job, new challenges, new beginnings. One of the things I’ve had to do as part of my new job is to build a base system to develop our new product on. We chose to use Vmware Fusion as we run iMac’s as development machines. My preferred Linux distribution happens to be CRUX as it’s lightweight, easy to maintain and “cruft-less”. The down-side (if you can call it that) is we (the CRUX community) don’t have that many x86_64 users so our x86_64 support is somewhat lacking. [Read More]

Testing With Mox

Last week I discovered the mocking library mox. I had previously known about the concept of mocking but had no experience in writing tests that mocked anything out… We use mocks quite a bit where I work and it was while implementing new functionality into our software that I learned also to write tests that used mocks (using the mox library/framework). The most challenging concept with mocking in general was deciding what to mock and what not to mock and how you should structure your test. [Read More]