Skip navigation.
Home

KenHayber's blog

Async python Socket Server using gobject

Recently I created a small command line python utility to process some stuff on a TCP socket connection. I used the standard python SocketServer class because it was dead simple to use for my purposes.

However, as the requirements of the utility grew (a GUI), I hit the main problem with SocketServers - they block - which is not so good for GUIs.

So, instead of using nasty old threading, I worked out how to use gobject.io_add_watch() to do everything in the gobject/gtk main loop. This makes it very simple to have this run in a gtk UI without needing threads.

python-launcher

Interesting Python speedup idea seen on planet.gnome.org.

Unfortunately using it I found 2 things:
1) all existing python scripts that do /usr/bin/python or /usr/bin/env python have to be modified (?)
2) currently it seems broken for any python app that does local imports, meaning it can't find 'findrox'!!

I may try to fix these and report later...but I wonder if this concept could be added to the Panel somehow.

SSHFS Mounts and AppDirs

I've been experimenting with a way to combine FUSE/SSHFS with ROX AppDirs and its support of mountpoints.

I have a hackish version now that works well enough for me. Perhaps others could suggest improvements.

Prerequisites:

ROX Filer, FUSE, SSHFS, and password-less ssh access to the remote host (see ssh-keygen and .ssh/authorized_keys).

The last part is required to keep the Filer/Desktop from hanging while waiting for a password to be entered.

Unmounting:

The standard umount command will not unmount fuse-mounted mountpoints. You need to use fusermount -u for that (or be root?). So, using the new configurable mount/umount commands in ROX-Filer 2.5, I created the following myumount command and put it in my path and set ROX-Filer to use this in place of umount.

Google Hosting

I was looking for an excuse to play with the new Google hosting service. So I put WiFi there - the reasoning being that it wasn't my code to begin with and if someone else wants to contribute it is a bit easier to give others access (than on my personal site).

I wonder if we should put other abandoned ROX stuff there.

In case you haven't checked it out (rox-wifi) they're offering a simple Home Page, Keywords, SVN access (with very simple web view), and an Issue Tracker with a very simple interface. Discussions can be linked to Google Groups.

Syndicate content