'HTTP-less CSW'

def _csw_local_dispatch(self, keywords=None, start=0, limit=10, bbox=None, identifier=None):

    mdict = dict(settings.PYCSW['CONFIGURATION'], **CONFIGURATION)
    if ('server' in settings.PYCSW['CONFIGURATION']):
        mdict['server'].update(settings.PYCSW['CONFIGURATION']['server'])
    config = SafeConfigParser()
    for (section, options) in mdict.iteritems():
        config.add_section(section)
        for (option, value) in options.iteritems():
            config.set(section, option, value)
    os.environ['QUERY_STRING'] = ''
    csw = server.Csw(config, version='2.0.2')
    csw.requesttype = 'GET'
    if (identifier is None):
        formats = []
        for f in self.catalogue.formats:
            formats.append(METADATA_FORMATS[f][0])
        csw.kvp = {'service': 'CSW', 'version': '2.0.2', 'elementsetname': 'full', 'typenames': formats, 'resulttype': 'results', 'constraintlanguage': 'CQL_TEXT', 'outputschema': 'http://www.isotc211.org/2005/gmd', 'constraint': None, 'startposition': start, 'maxrecords': limit}
        response = csw.getrecords()
    else:
        csw.kvp = {'service': 'CSW', 'version': '2.0.2', 'request': 'GetRecordById', 'id': identifier, 'outputschema': 'http://www.isotc211.org/2005/gmd'}
        try:
            response = csw.dispatch()
        except ReadingError:
            return []
    if isinstance(response, list):
        response = response[1]
    return response
