Archive for July, 2009

D-Bus system services for print queues

Sunday, July 26th, 2009

Further to the recent work on replacing hal-cups-utils, I’ve now split out the parts that use CUPS into a D-Bus system service. This allows udev to simply call the D-Bus methods and let the activated service deal with the potentially time-consuming bits. It also makes it a bit easier to get the SELinux security labelling right.

The interface is simple:

bus com.redhat.PrinterConfig
object /com/redhat/PrinterConfig
interface com.redhat.PrinterConfig

UsbPrinterAdd (STRING devpath, STRING deviceid)
UsbPrinterRemove (STRING devpath)

Next step: a D-Bus service for finding an appropriate PPD file for a given IEEE 1284 Device ID. This would allow the PrinterConfig implementation to avoid running a Python helper script to actually add the queue. The same goes for bluetooth devices.

Re-writing hal-cups-utils to avoid hal

Monday, July 20th, 2009

The program that adds printer queues when a USB printer is connected is hal-cups-utils. It is a simple program that hooks into hal, the hardware abstraction layer, and adds/enables/disables CUPS queues as necessary.

As hal will be going away shortly — that, and the fact that hal-cups-utils doesn’t really work very well — I have had a go at re-writing it as a udev rule over the last few days.

(more…)

Britain’s only large-scale wind turbine manufacturer to close

Saturday, July 18th, 2009

Vestas, the wind turbine manufacturing plant in Newport on the Isle of Wight is set to close this week despite a government pledge only hours earlier to build a green economy. There is a Friends of the Earth campaign about it here, urging the Secretary of State for Business, Innovation and Skills to save the UK’s wind power industry.

All of this comes at a time when the UK govenment has been accused of having an energy policy that’s too focused on wind power, and when companies trying to increase the UK’s supply of wind power such as Ecotricity are fighting years-long planning battles with local councils to install any. Dorset, the county where I live, has no wind turbines at all and one planning proposal was recently turned down by the council despite having been recommended by their own planning officers.

It’s a mad world.

Profiling Python

Thursday, July 16th, 2009

Yesterday I spent a little bit of time improving the speed of adding a new printer using system-config-printer. The main problem was that several bugs had conspired to make it search for all printer drivers three times instead of just once (oops). After fixing that I tried profiling it to see what was taking the most time.

(more…)