Tuesday, September 20, 2011

wxWoof

Rochester's getting colder. Autumn is here. I like that.

This past Saturday was the big Software Freedom event. I had a few people ask me about the spin, grab copies, so I pointed them to the public repo and showed them what went on in creating it (my previous post was editing for some more details regarding the process). It was good fun. And so was the hackathon. I didn't really go in with any particular project in mind, so I decided to get started on working on something that I've been meaning to work on for quite some time.

Ever hear of woof?

It's a nifty python (2.7) script that turns your computer into a single-file distribution server. Or, should you want, archive directories for you, and host the archive. It's pretty simple, but really useful. Need to toss a file over on your other box, and don't have a USB drive with you? No problem, just run the script on the file. By default, the script hosts it on port 8080. All you need to do to grab the file is open up your browser of choice, and connect at the host's ip (displayed if you don't know off hand), and selected port. Easy. (If you want -really- impressive speeds, try sharing a network connection from the host, and connecting the two via ethernet. That's some nice file transfer speeds.)

Some of my friends saw me using it, and really loved the script, but aren't familiar with the command line at all, or even the concept of a directory path. The script could also use a little python 3 makeover. So, I took the opportunity to start looking into some gui libraries to put a simple front-end on the script.

There were a few options. If you can recall, I already messed around with pygtk2, which was very simple and powerful. It is, however, getting it to work in OSX 10.5 and later is annoying. I then looked into something more current and robust, and stumbled upon PyQt, based on the mammoth Qt framework by Nokia. In the end I decided to just use the tried and true wxPython libraries.

This wasn't without it's issues, either, though, as wxPython hasn't been updated to work properly with Python 64 bit installs. I actually had to create a little launcher that appropriately ran my ui correctly. This was accomplished by using the following script:

#! /usr/bin/env python

import subprocess

subprocess.call(["arch", "-i386", "python", "window.py"])



You can check out my very simple gui at the public repo if you're interested. Right now, I got something that works, but I'll continue to add to and improve the UI (as well as clean up the script) over time and post more about it in the near future. Chances are I'll take a look at wxDesigner and wxGlade.

No comments:

Post a Comment