I would like to use the WsgiService library to write a REST service on Google App Engine (GAE). The two features I like most are the way it automatically outputs a certain format (JSON, XML, …) depending on the file name ending in the request path. Also it is able to directly map parts of the path to variables using regular expressions.
The official tutorial uses class decorators which are not available in Python 2.5 and therefore GAE throws an invalid syntax exception. Stack Overflow question Class decorators in Python 2.5? mentions that class decorators are just syntactic sugar and can be replaced with backwards compatible code. Also the wsgiservice documentation doesn’t mention that Python 2.6 is strictly required. Unfortunately I was not able to replace the class decorators to make it run on GAE.
Is it possible to replace the class decorators in the tutorial to run with Python 2.5? If not, is there any other library which provides the above functionality while being GAE compatible?
The PKG-INFO file of WsgiService contains the following line
Classifier: Programming Language :: Python :: 2.6
and therefore does not suit GAE (Python 2.5).
The requested features can be achieved with different URL mappings, as described here:
http://code.google.com/appengine/docs/python/tools/webapp/running.html#URL_Mappings