Skip to content.

Green Leaf Technologies

Sections
Personal tools
You are here: blog

Tom's Blog - Category: Python

Created on 14th June 2007 01:41 AM. Python | Gnome 8 comments
Started working on a project which I'm calling macula which will give you a wallpaper slideshow based on photos matching a tag in F-Spot .

Seems to be working quite nicely. You set the options in gconf (it's a gnome app) for which tag you want to use and what interval for the slideshow you want, and then just run the program. It will use any changed config options each time it changes, so if you set it to one tag and then run it and change it, it will use the new tag the next time it changes.

The next stage is to write a config front end so you don't have to edit gconf, and then write an install program (at the moment you have to manually insert it as a new program to start up as part of a Gnome session). Problem is, it works fine for me, so the motivation to do that is not so high. Hopefully I'll get around to it soon.

Created on 16th February 2007 07:52 AM. Python | Linux 2 comments
I've found it - musical heaven on Linux .

Exaile is pretty much a drop in replacement for Amarok . I've always liked Amarok, particularly for the cover art, smart playlists and general music management, but I can't deny there's something unpleasant about running a native KDE app on Gnome. Exaile is written in Python, GTK-based, and has all the features and smoothness of Amarok - but for Gnome. Love it, love it, love it. Having tabbed playlists so you can have multiple open at the same time also seems like a big improvement on Amarok as well.

Instructions for install on Ubuntu here .

Edit [2007-02-21]: After some issues with Exaile not showing the album covers correctly and not being able to seek to a particular point in a Podcast, I'm currently trying out Listen instead. Will update in a few weeks based on how I get on...

Created on 4th January 2007 04:19 PM. Python
In the eternal battle between morons and assholes , I would place myself in the moron camp.
Just hoping that as often as possible, I become a moron-turned-expert.
Created on 12th December 2006 11:08 AM. Python | Linux 1 comment
Just did an almost completely painless upgrade on this server from Sarge to Etch . Fantastic.
  1. Edit /etc/apt/sources.list
  2. Run sudo apt-get update && sudo apt-get dist-upgrade
  3. Enjoy!

There were two small gotchas. Because I was upgrading glibc I had to stop PostgreSQL first. And I had to change the apache startup script to remove the startssl option (deprecated). Other than that, all good.

Amazing how painless that was.

Now I have python 2.4 it's time to decorate !

Created on 17th October 2006 01:27 PM. Python 1 comment
Well it's been a little while in getting there, but the Green Leaf Technologies source code browser is back online .

Finally got around to installing and configuring ViewCVS , which, despite the name, can quite happily view a Subversion repo - which is what I have.

Was a little less than intuitive, I have to say, but now that I understand it all, it's quite well laid out. One central config file, nice syntax highlighting, and the thing I do like particularly is that it can create on-the-fly gzips of any directory. Nice for people to be able to download the source straight from the repo browser. Oh, and in the end, I just installed it from the debian repositories instead of from source, as the most up to date version required Subversion 1.20 or greater. I'm always pleasantly surprised by how many packages are available as .debs. Makes management much easier. 

Created on 27th September 2006 03:51 PM. Python
Generating an RSS feed from a Database query is ridiculously easy with Python's awkwardly named PyRSS2Gen module.

Here's how simple it is. Create your database query, and then throw it into PyRSS2Gen's RSSItem method. Then create an RSS2 feed. This code shows you how:

 

items = []

 

for row in databaseitems: 

  items.append(
    PyRSS2Gen.RSSItem(
      title = row['title'], link = row['link'],
      description = row['description'],
      guid = PyRSS2Gen.Guid(row['guid']), pubDate = row['pub_date']    )  )

PyRSS2Gen.RSS2(
        title         = "Feed Title",
        link          = "http://localhost/test URL",
        description   = "Feed Description",
        lastBuildDate = datetime.datetime.now(),
        items         = items).write_xml(open("test.xml", "w"))

 

You can then connect to this with your rss reader by publishing the xml to a web directory and pointing your RSS reader to the location of the XML file. Very nice. 

Created on 14th September 2006 08:19 PM. Python
What's prompting this flurry of blog postings? Sometimes you just gotta share... Deskbar is great. I knew that before, but now I'm sure    

When I first discovered deskbar, I thought - great, now Linux has something that Mac already has, and that's a good thing because it means we're not so far behind.

But this time around, I've discovered it's not just a nice little applet that can match the functionality of the Mac applet, it's actually something that's very useful to me and I'm going to be using it as an integral part of my work schedule from now on. I love being able to send email to contacts from the deskbar, and initiate web, file content and/or file searches from the same place. Nice looking plugin architecture for it as well - been seeing some interesting add-ons on various blog postings recently including a built in calculator.

And it's written in python, which obviously tickles me in the right place. 

Created on 14th September 2006 12:31 PM. Python 2 comments
Today saw the end of an era - finally removed all Zope and Plone packages from the Green Leaf Technologies servers.
An impending apt-upgrade for zope2.7 reminded me that I still had Zope installed. Duly uninstalled them. Thanks for the service you gave me, guys, but I just found you too complicated to dive into and in the end you were nudged out by Django .
Created on 13th June 2006 07:41 PM. Django | Python
It's taken me a while to get there, but I've finally migrated to Django.

This has been helped (a lot) by my being able to use Django at work. I've really been able to dig into learning some of the features of this great framework, and it's convinced me (along with Plone's resource intensive-ness for a poor wee server like mine) that I needed to get with it.

So I did.