PyChannels Introduction
PyChannels Introduction
Tue, 07/05/2005 - 05:35 — Derek AndersonOne of my responsibilities for Defcon this year is going to be a channel information "ticker" for the TV feeds at the hotel. Channel 2 will be replaced with this neat little app, which should be completed fairly soon. I am posting this test release just so that everybody can get a quick feel for it.
More news follows...
One of the problems with the PyGame SDL wrapper is that it lacks a decent text layout engine; so I wrote one. The paragraphText object generates an SDL surface that contains correctly wrapped text (sorry, no justification) which fits inside of the rectangle given to it. I am still working on automatic hyphenation, but for now it does a pretty decent job.
Next thing I had to do was generate cleaned up scrolling news from an RSS feed. For this job I leveraged the excellent feedparser from Mark Pilgrim, and some simple regexes to remove the tags.
Finally, I was relieved to discover that there is a CSV import module for Python, which is what I am (planning on) using for the channel and time database. The code here is still a little thin since I have spent a lot of time working on my paying projects.
Side note: A couple of years I would have thought I had died and gone to heaven if I had enough paying work for 50 hours a week. Now that I have it, I wish I was unemployed. Crazy huh? Either you have the money to have fun, or the time, not both.


