Day: April 8, 2005

  • Rapid Python for Series 60 Development

    Right now I’m writing Python for Series 60 apps on my Ubuntu laptop and testing with a Nokia N-Gage (the infamous taco). The taco is an excellent (and inexpensive) development/testing platform for Python for Series 60 because it offers a USB connection that once connected allows you full access to the contents of the MMC. After a few rounds of navigating to the right spot on the MMC and then dragging my .py file using Nautilus, I decided to automate the process a bit. Here’s a little bash script (I call it py2phone) that has made my life quite simple:

    #!/bin/bash
    cp $1 /media/usbdisk/system/apps/python/my
    sudo umount /dev/sda1

    It copies the first command line argument to the correct spot on the MMC and then handles the umount command so that I can immediately disconnect the USB cable and test on the device. I usually copy to the device after running through it using the PDIS Series 60 compatability library, which helps me find stupid syntax errors before copying to the device. The comatability library sits on top of wxPython and implements most of the basic appuifw functions. I would really like to stub out content_handler to acknowledge the call rather than stacktrace, but other than that the compatability library absolutely rocks for debugging before transfering to the device.

    Here’s my development cycle, which when I’m fixing, tweaking or experimenting, can last all of a few seconds:

    1. Edit file.py file (I’m currently using GEdit for syntax highlighting)
    2. run python file.py at the command line to run through the app on the laptop
    3. ./py2phone file.py
    4. Unhook USB cable, test app on device

    The next step is to automate this process further by extending my little bash to handle the test call, ask if everything went okay, and then conditionally copying the file to the phone and unmounting the device.