Learning Python
Having switched my work PC to ubuntu, I cannot run the Windows software we use to listen for channel announcements. Rather than starting up ethereal and sniffing for the announcements, I’ve decided to learn python by writing a small application that will listen for these announcements and display them on a list.
Glade, pyGTK, and python.
First up I wanted this application to run in a window as opposed to the command line. Using glade makes designing a user interface really easy. Just run glade and choose what kind of window you want. In this case a list view. However there is no such thing as a list view, however by reading further at (link to pyGTK) I realised that a list-View is a subset of a tree-view. There is even a sorted list subclass
Having saved your user interface, pyGTK allows you start the window and connect to user events, e.g. clicks, close, destroy etc. I had an extra problem my application was to be driven not by user but by the arrival of announcement packets. So this required me to open a network socket and tie the input of that to a window event. Once that is done every time a packet arrives the window calls my packet processing function.
It has taken me a couple of days to get the thing usable. It is a weird language to write in, it looks like psuedo-code. The integratation with the gnome gtk make drawing a gui a cinch. It will be much easier for me to whip up pretty professional looking apps in the future. Here’s my list of TODOs to improve announcelist
TODO
- allow a double click to open a stream
- have a maintenance list using snmp which opens the management interface on the devices.

Leave a Reply