Blog Update | Django 1.0

The blog code has been updated to be compliant with the recent release of Django 1.0. And a small patch from Jeff.

Permalink | Posted: Sep 05, 2008 | Tags: django python blog

UTOSC Slides and Related Files

I presented at UTOSC this year, presenting a series of tips and best practices that I've learned from Oggify. Entitled Things I've Learned From Oggify, the slides are available on the conference site. There are a few files I used in the presentation which I have put in a tar and uploaded. Enjoy!

Permalink | Posted: Sep 10, 2008 | Tags: 42 python utosc

Rambling on Git

So during my UTOSC presentation I add some spare time, and ended up doing a "Git in Five Minutes" demo. I've done a written version for everyone to enjoy. So yes, I've written a Git tutorial.

Oh, and this Git Magic tutorial is pretty good too.

Permalink | Posted: Sep 10, 2008 | Tags: programming tips git

Key-Value Coding in PyObjC

So when doing GUIs in with PyObjC you'll realize that the IBOutlet for tying objects to variables have a few limitations. The one I hit was that a single outlet can only be connected to one object. So I read up on Key-value coding. So to do this you have to add two functions per variable:

def name(self):
     return self.var
def setName(self, x):
     self.var = x

You can imagine that this becomes tedious really fast. Luckily there is a solution. As an example:

from PyObjCTools.KeyValueCoding import kvc

class controller(NSWindowController, kvc):
    title = ""
    artist = ""
    album = ""

So this ties __getattr__ and __setattr__ to valueForKey: and setValue:forKey. Making every class variable available for Key-value coding. Very handy.

Permalink | 1 comment | Posted: Sep 10, 2008 | Tags: python pyobjc cocoa

Now on Twitter

Well, I've finally given in, and am now on Twitter. You can find me as _ spr _ (hm. that's _spr_. python-markdown has a bug).

Permalink | Posted: Sep 26, 2008 | Tags: 42

Building Cocoa GUIs in Python with PyObjC, Part Five

Adding Python Modules to the Bundle

If you try to use Python modules on the standard OS X Python path import statements will work fine. However, if you have non-standard modules that might be in a different location, or ones that you want to ship with, you will notice you can't just import them.

To bring them into the application bundle you'll have to go through a couple steps, but when it is all done the application will be able to use the modules, and you don't have to require the end user to install anything extra.

  1. Add the files to the Xcode project.

    • Select 'Project -> Add to Project' (option-command-a)
    • Select the Python module (directory) that you want to add.
    • On the next screen select "Copy items into destination group's folder (if needed) Add to Project dialog
    • Select the correct targets in 'Add to Targets'
    • Select "Create Folder References for ...

Continue Reading

Permalink | Posted: Sep 29, 2008 | Tags: python osx programming pyobjc cocoa

Entries for August, 2008

Entries for October, 2008

Tags

42 | django | python | oggify | OSCON | OSCON07 | osx | utosc | mythtv | security | reading | music | gaming | programming | tips | shell | vim | pyobjc | cocoa | iphone | blog | git

Calendar

<< Sep >>
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 1 2 3 4 5

Search

This space reserved for a search box

A Django site. Hosted on a Slicehost Slice