Apache mod_wsgi with Trac and Bazaar

I recently installed the mod_wsgi Apache module and configured Trac and Bazaar to use it. Here are some notes that others might find useful.

Trac


The mod_wsgi documentation on Integration with Trac provides information about many different configurations, as it should. However, much of the document discusses setting environment variables from within the script using os.environ. As the document notes, this is problematic if you want to run multiple instances of Trac within the same process. I think using SetEnv from within the Apache config is a far better approach (which is discussed towards the end of the document). This also allows you to use the same, minimal wsgi script for many instances of Trac.

The document also demonstrates setting the PYTHON_EGG_CACHE environment variable via os.environ. This can only be set once per process anyway. However, if you're running in embedded mode, a more elegant way to do it is to use the WSGIPythonEggs configuration directive.

Bazaar


The Bazaar User Guide describes configuring the Bazaar http smart server with fastcgi and mod_python, but not mod_wsgi. This mailing list post describes configuring it with mod_wsgi. As above, I prefer to set the environment in the Apache configuration so I can use the same script for multiple configurations.

My script is as follows:
from bzrlib.transport.http import wsgi

def application(environ, start_response):
return wsgi.make_app(
root=environ["bzr_wsgi.root"],
prefix=environ["bzr_wsgi.prefix"],
readonly=True,
enable_logging=False
)(environ, start_response)


With this script, you can specify the root and prefix passed to the bzr smart server wsgi application using SetEnv in the Apache configuration.

Here is an example configuration snippet making an entire tree useable with the bzr smart server. The prefix is set to "/", which means that the root (/) of the http host corresponds to /srv/bzr in the filesystem.
    WSGIScriptAliasMatch ^.*/\.bzr/smart$ /usr/local/share/wsgi/bzr.wsgi
<Location />
WSGIApplicationGroup %{GLOBAL}
SetEnv bzr_wsgi.root /srv/bzr
SetEnv bzr_wsgi.prefix /
</Location>

If you have branches in shared bazaar repositories and are experiencing errors related to "server jail" or "jail break" when you try to access them, you are probably experiencing bug #348308. See the bug report for a temporary work around.
read more

Touch Screen Keyboard Difficulty for the Blind: A Potential Solution

There's been a lot of talk about VoiceOver on the iPhone 3G S... and so there should be. I suspect (and others seem to concur) that Apple's model for touch screen accessibility ought to be quite useable under most circumstances, but that typing on the touch screen keyboard could be rather challenging, perhaps the most challenging aspect of the interface.

Thinking about this, I had a brainwave: perhaps a Braille touch screen keyboard could be a nicer solution for blind users. A Braille keyboard doesn't require you to shift your fingers horizontally or vertically, which eliminates the challenge of finding characters. Instead, you only need to raise or lower your fingers in various combinations. I'm guessing that the multi-touch touch screen should be able to detect these combinations. I can't remember how big the touch screen on the iPhone is, but I suspect it is probably large enough to allow for the fingers to be placed in Braille typing formation. I can't type as fast on a braille keyboard as I can on a QWERTY keyboard, but I'm a hell of a lot faster on a Braille keyboard than on a phone keypad. In fact, I'm wondering whether this method of input would actually be faster (assuming a proficient Braille typist) than a sighted user using the normal touch screen keyboard.

Surely I'm not the first to wonder about this... or is this really a new idea?
read more

EU Objections to Microsoft's Bundling of Internet Explorer with Windows: My Thoughts

In January, the European Commission sent a Statement of Objections to Microsoft expressing their preliminary view that the inclusion of Internet Explorer in Windows has violated European competition law. Subsequently, Microsoft announced that Windows 7 will ship without Internet Explorer in Europe.

First, let me emphasise a few points. I've certainly had some negative things to say about Microsoft in my time. They're certainly no angels. I'm a huge advocate of free, open technologies and software. I'm a Mozilla Firefox user and advocate it strongly over Internet Explorer. All of that said, I can't fully support this case. It's certainly true that, given the dominant position of Windows, bundling Internet Explorer with Windows has given it an advantage that no other browser could have achieved, thereby allowing it to markedly dominate the browser market. This has undoubtedly caused a great deal of damage to innovation and competition. However, as argued by Jean-Louis Gassée concerning the earlier United States case against Microsoft, given the increasing prominence of the internet, consumers expect to have a browser packaged with the operating system. Apple bundle Safari and many other applications with Mac OS X - one of the strongpoints of the Mac is that everything is so tightly and nicely integrated - yet no such complaint has been made about Apple. There are many other platforms that bundle a web browser also.

Microsoft's domination of the desktop computer world obviously makes the impact of bundling much greater. Even so, I can't help feeling this is at least a bit unfair. It could be argued that the removal of Internet Explorer from Windows actually puts it at a disadvantage when compared to Mac OS X, which still includes Safari. Furthermore, without a bundled browser, a user can't connect to the internet to download a browser, which impedes internet usage. In the end, will Windows be the only platform which doesn't bundle a web browser?
read more

New Apple iPhone Accessible to the Blind: My Thoughts

Apple have just announced that the soon-to-be-released iPhone 3G S will include the VoiceOver screen reader, among other accessibility enhancements. Although I'm still uncertain as to the efficiency of a touch screen interface for the blind, this is fantastic news. For the first time, an every day mobile phone/PDA will include a screen reader as part of the core product at no extra cost. Apple's inclusion of VoiceOver into Mac OS X was revolutionary news, and they've now done it again with the iPhone. I'm sometimes rather cynical towards Apple, but I am continually impressed by their commitment to incorporating out-of-the-box accessibility into their products.

It's worth noting that the iPhone is not the first touch screen phone to include accessibility for the blind. A suite of self-voicing applications called Eyes-Free is available for Android which enables blind users to use many functions of the phone. While this is great to see, it's disappointing that this is what I call isolating (or isolationalist) accessibility; i.e. blind users must use a different set of applications to everyone else to access the phone and are thus isolated from the experience of other users. This appears to be a (in my opinion disappointing) trend for some sections of Google, as demonstrated in the separate, so-called "ARIA enhanced" and "accessible" versions of some of their services, wherein they often present a different interface for blind users instead of integrating accessibility right into the existing interface. I think that isolating accessibility certainly has its place - it can sometimes make for a more friendly and easier learnt interface and is the only practical option in some extremely visual scenarios - but in general, I believe it is extremely limiting and inflexible. Admittedly, a touch screen interface is inherently visual and thus presents a new set of challenges. Not only does the user interface need to be spoken or brailled, but the method of input needs significant adaptation to be used by a blind person. This is probably why the Android Eyes-Free developers chose the path they did. However, Apple have taken a better, more generic approach similar to that of most modern operating systems, allowing blind users to use the same applications as everyone else. The new iPhone incorporates accessibility into the core of the operating system and VoiceOver modifies the input method as well as reading the user interface, which allows any application to be accessible with VoiceOver, including all of the in-built applications.

Experience will determine whether Apple's implementation is optimal for blind users. Regardless, they've truly raised the bar for mobile accessibility.

Disclaimer: I have not had any personal experience with either VoiceOver on the iPhone 3G S or Android Eyes-Free. These thoughts are solely based on the information I have gleaned from various internet sources.
read more

Too Lazy to be Lazy

For a while now, I've been thinking about writing a tool to quickly perform all sorts of little miscellaneous tasks that I'm too lazy to do manually. They aren't big enough to each justify their own application, but nor are they at all related. These tasks include:
I came up with a great name for this application: Jantrid Laziness Proliferator. Unfortunately, I'm too lazy to actually write it...
read more

Cakewalk Sonar vs Pro Tools

A post on the JSonar blog pointed me at this thread on the Cakewalk forum comparing Sonar and Pro Tools. I find it surprising that Sonar's poor audio scrubbing functionality (versus Pro Tools's reportedly excellent scrubbing) is not mentioned at all! I keep hearing that many good sound engineers still prefer to "use their ears" a great deal and I'd figure they would therefore use scrubbing a lot, but the opinion from Cakewalk seems to be that scrubbing isn't used by most users and thus isn't a priority. The forum thread does discuss Pro Tools's strength in sound engineering and post production and its relative lack of popularity with composers, which I guess might explain this. If Sonar's primary market is composers and the like, there might certainly be less of a demand for features such as scrubbing. This is a damned shame for me (and I suspect many other blind users), as decent scrubbing (i.e. better accuracy and the ability to play faster than 1x) would make my life a hell of a lot easier, not to mention more fun!
read more

Today's Dose of Lame Jamie Humour

Jen: "Watch the door... it's ajar."
Jamie: (casually, without pause) "No it's not! It's a door!"

... I thought it was kinda clever, personally, but perhaps I've been awake too long...
read more

Tired of Incompetence/Bad Service

So we're in the process of finalising the purchase of our house, which is all very exciting. However, the administrivia is quite the opposite, as illustrated in the following series of events:
  1. A few weeks ago: Our mortgage broker sent our First Home Owners grant documents to St George, our bank. Our mortgage broker then called to confirm that they had been received.
  2. A couple of weeks ago: I called NRMA (our insurance company) to ask them to raise the building insurance amount to the amount specified by the bank. (My original figure was obviously an underestimate.) They told me that this was all done, no worries.
  3. Early last week: Jen sent the insurance documents to St George. She also emailed our solicitor with a request to settle a few days earlier.
  4. Last Friday: No contact yet from our solicitor, so I called his office to confirm that the request was received and actioned. He's not in the office; apparently, he'll call me back on Monday morning.
  5. Monday afternoon: No call from our solicitor. I called him late afternoon. I noted that he mustn't be receiving our calls and emails. He noteably neglects to mention the email, but was surprised about the call on Friday. He told me that St George apparently haven't received our insurance documents (see 1), nor our First Home Owners Grant documents (see 3).
  6. Tuesday: Jen had to drive to visit our mortgage broker to sign new First Home Owners Grant documents.
  7. Wednesday morning: Jen called NRMA to ask them to fax our updated insurance documents to St George. She discovered that apparently, our record states the old insurance amount instead of the updated amount (see 2). Our solicitor called me to tell me that the received fax was missing some information. Jen subsequently called NRMA and they said that the information was correct in the records but that the fax was somehow incorrectly generated.

All is now finally sorted, but.... aaaaaaaaarrrrrrrrrrrrggggg!
read more

Paraskavedekatriaphobia

The new Bazaar 1.13rc1 release is codenamed paraskavedekatriaphobia. Having no idea what the hell that was, I decided to look it up, and as usual, Wikipedia furnished me with the answer: the fear of Friday the 13th. If I knew the smiley for rolling eyes, I'd be using it here...

Well, you learn something new every day.
read more

I, Lord of Olive Pits...

Jen and I noticed a fascinating glitch in the laws of probability recently. If we are eating something containing pitted olives - home made pizza, for example - I end up with all of the olives which mistakenly contain pits, while Jen encounters none. We're not just talking one, here. It's usually at least three or four. This has happened a few times now. To prove the point even more, after happily enjoying pizza free of olive pits (while laughing at my somewhat less peaceful pizza experience), Jen gave hungry me a piece of her pizza... and guess what I found when I ate it? Yup... more olive pits. I guess a more logical explanation might be that Jen is consciously or unconsciously doing this...

Actually, this title is rather unsuitable. If I am the lord of olive pits, surely I could convince them to cower and run away or something...
read more