imatix/zguide — pull request #138 by minrk (2011-11-30 09:02:26+00:00)
Title: some work on Python examples

I did a bit of work on Python examples in the Guide

Changes:

* removed version.py, which was redundant with zversion.py, but used a weird import I wouldn't recommend.
* renamed bstarsvr.py -> bstarsrv.py to match other languages.
* in zhelpers.py:
- the ROUTER/DEALER fix for old pyzmq checks directly for the missing values,
rather than using the version number, which would fail with pyzmq-dev.
- use stdlib methods for printing, rather than character-by-character approach cloned from zhelpers.h
(output is unchanged).
* in interrupt.py:
- add case indicating that pyzmq throws KeyboardInterrupts just like any regular Python function.
* lruqueue.py / lruqueue2.py had comments suggesting that empty frames were being swallowed by pyzmq,
but in fact they were missing because they were never sent.

New translations:

* lruqueue3.py - using pyzmq ZMQStream/IOLoop for reactor
* peering2.py, peering3.py

Tiny changes outside Python examples, encountered during work:

* added some generated file patterns to gitignore (.pyc,.pyo,.DS_Store,.o)
* peering3.c:
- The guide says that clients don't print themselves, but rather send messages to a monitor, which prints.
The code didn't actually do this, but now it does.
- A comment suggested `randof(2)` generates 0/1/2, when in fact it just does 0/1.