Thursday, December 4, 2003


Cool. Wilcox is continuing to explore PyObjC:

Having posted a bit about PyObjC, and my first initial impressions, I decided to tackle a bigger (but still example sized) project with it. [Wilcox Development Solutions Project Blog]

When we created PyObjC, one of the goals was to emphasize simplicity.... to make it as natural as possible to Python developers without obfuscating the ObjC APIs.

Unlike Objective-C, Python collections tend to work automatically in a number of contexts. For example, you can use the in operator to enumerate an array:

for aPath in arrayOfPaths:
    print aPath

The same holds true for Objective-C collections that are bridged into Python. In the above example, arrayOfPaths could be a Python collection or an Objective-C array, it works either way.

In reality, it is more flexible than that. The bridging of the behavior is based on the methods an object responds to. That is, any object that responds to either -nextObject or objectAtIndex: (and count) can be used on the right-hand-side of the in operator.

As such, enumerating the current working directory can be done like this:

from Foundation import *
de = NSFileManager.defaultManager().enumeratorAtPath_(".")
for aPath in de:
    print aPath

The same holds true in the other direction. Any Python List will show up on the ObjC side of the bridge as an instance of NSArray (or NSMutableArray). Same for dictionaries.
10:15:13 PM  pontificate    


Any conspiracy between today's Comcast announcement that they are entering the PVR market and today's Comcast channel lineup change completely breaking on the TiVo?

Problem not a conspiracy. Who knows. I'll be glad when it is fixed. There are about 3 shows a week that I like to watch. After having owned a TiVo since the beginning of TiVO Time, I can no longer tolerate watching non-TiVO'd TV. Don't have the patience for it.

Hope the problem is fixed soon.

Problem fixed! I forced my TiVo to check the central scrutinizer for updated scheduling information (fast over 802.11!) and all is well once I found the right cable lineup. I also discovered that Zap 2 It purchases their lineup information from the same source as TiVo. It is much easier to hunt through the different lineups via a computer based interface than a TV based interface (more dots, sharper text, more text on screen).
12:26:52 AM  pontificate