Created
May 15, 2012 13:30
-
-
Save amercader/2701799 to your computer and use it in GitHub Desktop.
pycsw / CKAn integration proof of concept
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CSWController(BaseController): | |
def dispatch(self): | |
import os | |
from pycsw.server import server | |
from pylons import request, response | |
env = request.environ | |
pycsw_config = config.get('ckanext.spatial.pycsw.config') | |
csw = server.Csw(pycsw_config, env) | |
contents = csw.dispatch_wsgi() | |
response.headers['Content-Length'] = str(len(contents)) | |
response.headers['Content-Type'] = csw.contenttype | |
response.status = '200 OK' | |
return contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update: pycsw can now accept configuration as a Python dict as well.