QGIS 2.8: Define your own Python Functionshttp://www.northrivergeographic.com/archives/upcoming-fun-qgis-2-8-define-python-functions