Python decorators with optional arguments

Ever seen decorators which can be used like this? Django’s template filter registration decorator is a good example of this, where it can be called as either a decorator, or a function that returns a decorator (specifically, a function that … Continue reading

Posted in Python | Leave a comment

High memory usage when using Python’s tarfile module

The Python tarfile module is a handy way to access files within tar archives without needing to unpack them first. You can iterate over files using the following pattern: Behind the scenes, each TarFile object maintains a list of members … Continue reading

Posted in Python | Tagged , , , | 1 Comment

Exchange Web Services, suds, and Python

This post is out of date. Please see this new post about Exchange 2010. I’d quite like to be able to interact with the University’s Exchange 2007 instance (Nexus) programmatically using suds (a Python SOAP client) and Exchange Web Services … Continue reading

Posted in Exchange Web Services, Python, SharePoint and Exchange | Tagged , , , , , | 8 Comments

Django, class-based views, metaclassing, and view validation

Mobile Oxford is a Django website which uses class-based views for greater flexibility. This article explains how this works and what it enables us to do, before explaining some basic validation based on view signatures.

Posted in Django, Erewhon, Mobile Oxford, Python | Tagged , , , | 1 Comment