Tuesday 22 July 2008

Getting the Three Huawei E169G 3g modem working under Ubuntu

I've managed to get my new Huawei E169G 3g modem working fine under Ubuntu Hardy.

I cheated and downloaded the Vodafone 3g driver from
http://betavine.net/bvportal/web/linux_drivers.

The settings I used are as follows:
number: *99#
chap
username: three
password: three
APN: 3internet

Manual DNS settings (I always use openDNS - its safer and quicker):
208.67.222.222
208.67.220.220

I highly recommend the 3g stick - its working beautifully - if only the 3g coverage were better in the UK....

Monday 21 July 2008

Scripting OpenOffice.org from Python - too hard

How hard should it be? I wanted to drive the OpenOffice.org Calc app from an external copy of Python under windows, and I've given up trying.

I can do it very easily in Excel, using the COM interface, but OOo has me beaten.

I've got a Python script that I use in a test environment, to put the results directly into a spreadsheet report. I'm running Python 2.5.2 and OOo 2.4.

I start to read the documentation, and it says there's a Python module I can use (uno) - great, says I - where do I get it from? It seems that its included with the OOo installation, in the 'program' directory - excellent! So I add the program directory to my Python path:

import sys
sys.path.append(r"C:\Program Files\OpenOffice.org 2.4\program")

and import it,

import uno

and I immediately get the following excepion: 'ImportError: No module named pyuno'. It seems that pyuno is a DLL library that uno needs.

Where do I go from there? I get a vague hint from the documentation that I may need to re-build the DLL for my version of Python. Ouch! It shouldn't be this hard. I haven't got time to get the the bottom of this. Why is this a DLL? What's wrong with a good old .py file. Its not like there's some proprietary technology that needs to be protected within the DLL.

At this point, I've given up on OOo, for this project at least, and I'll be going back to Excel, with its good old COM interface. I'd rather be using Open-Source software, but on this occasion, its too difficult. A pity.