Archive for February, 2006

February 25, 2006: 3:19 pm: kpdwxPython

When generating code for a given class, wxGlade will generate code corresponding to the first time it sees a given class name. This can lead to basically empty classes if you define your application frame first and it incorporates an application-specific window class. If you then later define the application-specific window class as an outer level panel – say for reuse, you will not get the generated python code. For example:

MyAppFrame
        panel in MyAppFrame of class CustomPanel
CustomPanel
        theButton

The python code generated for Custom panel will not contain code for ‘theButton.’ The solution is to move the definition of your custom classes ahead of any classes that reference them:
CustomPanel
      theButton
MyAppFrame
     panel in MyAppFrame of class CustomPanel

Would generate code for CustomPanel that has the ‘theButton‘ present as desired.

February 22, 2006: 7:25 am: kpdrowing

I saw these over at the Art of Rowing and they made me laugh out loud. Great rowing cartoons such as ‘Mount Rushmore 4,’ ‘David and His Single,’ and ‘Whistler’s Mother on an Erg.’ Great stuff!

: 6:32 am: kpdPython, wxPython

I was having trouble getting text to align correctly. Setting the background color of the item in question ( the label in this case ) to a different color than the dialog’s normal background helped identify the problem. I thought the item was not getting left-aligned correctly, but it turns out it was, the size of the column was just not what I expected. Any way, try changing colors to learn more about sizers.

changing background color of a sizer item

February 21, 2006: 12:07 am: kpdPython

I’ve spent some time working on a new site ( luckycharmsfordogs.com ) for a friend today. I am using Tahchee . Tahchee extends the Cheetah Template library, making it much easier to prototype and create websites. You first generate a local version of the site that has relative file links. This version of the site works great from a browser using the file system – no server required. Once ready, you then generate a remote version of the site. This version has absolute urls. A secondary benefit is that Tahchee made me finally figure out template inheritance in Cheetah.

One item that did cause problems was a side-effect from the fact that I am currently developing on Windows. Tahchee uses os.path.normpath. On windows this will replace forward slashes with backslashes. The server didn’t like this. Simply removing the calls to os.path.normpath in lines 239 and 246 of Tahchee solved the problem.

It’s a nice system and well worth checking out.

February 7, 2006: 7:33 am: kpdWordPress

This is a frequently asked question on the WordPress site. The answer is there if you have nice URLs enabled. If you do not, the answer is:

  1. Mouse-over your category list and note the integer after the cat=? parameter of the URL
  2. Append ‘&cat=?’ to your normal RSS feed URL

For example, the RSS feed for rowing posts only on this blog is:

http://powertwenty.com/kpd/blog/?feed=rss2&cat=2

Update 1/17/2007:
Using Weichung Yang’s Urlencoded Permalinks plugin this is even easier as the link becomes:

http://powertwenty.com/kpd/blog/index.php/category/rowing/feed/

: 7:11 am: kpdPython

The February meeting was last night. Xteric Technology Group hosted the meeting and provided pizza. Mike Pirnat and David Stanek gave a preview of their forthcoming PyCon presentation on the use of Python in an enterprise-wide, highly scalable, and redundant environment. Their talk will give good ammunition for those faced with the ‘python is too slow for enterprise usage’ argument. David then followed up with an eye-opening overview of the Kid Templating system. I had written off Kid due to its affinity for XML and my happiness with Cheetah, but the enthusiastic support of Kid at the meeting convinced me to take a look at it some day.

February 1, 2006: 6:31 pm: kpdMicro-isv

There’s a great discussion over on The Business of Software regarding small-business podcasts.

While Venture Voice contains great material, the best audio I’ve heard regarding the micro-isv world is not a podcast, but audio posted over at Niall Kennedy’s blog from the OSX conference. The audio is from a panel discussion called ‘How To Run Your Own Software Business.’ It consists of Oliver Breidenbach, Steve Dekorte, Steve Gehrman, Will Shipley, Brent Simmons, and Dan Wood discussing their experiences running small businesses. Don’t miss it!

: 6:22 pm: kpdPython, wxPython

Argh. I just realized today I had the *wrong* code posted in this example. The original post now contains the correct code.