# $Id$ # $URL$ websiteConfig = configs[ 'website'] availabilityConfig = configs['availability'] drilldownConfig = configs['drilldown'] def readJavascriptConfig(): # BE AWARE The python configread converts all keys to lowercase! sysconfig = {} sysconfig ['minCoverWidth'] = int (websiteConfig.get('minCoverWidth' , section = 'behavior', default="16")) collectionList = {} sysconfig ['depotCollectionList'] = availabilityConfig.getList('collectionList', section = 'collections' ) sysconfig ['depotExceptionList'] = availabilityConfig.getList('exceptionList', section = 'collections' ) sysconfig ['pub'] = websiteConfig.getSectionDict(section = 'publishers') sysconfig ['translateHash'] = websiteConfig.getSectionDict(section = 'javascriptTranslationTable') sysconfig ['availabilityGroups'] = websiteConfig.getSectionDict(section = 'javascriptAvailabilityGroups') sysconfig ['translateHash' ] ['less'] = drilldownConfig.get('less', section = 'facets') sysconfigJSON = dumps(sysconfig) # any.spit(sysconfig) return base64.b64encode(sysconfigJSON) def main(*args, **kwargs): # sysconfig = base64.b64encode('{"productId":12345678,"price":24.5,"inStock":true,"bananas":null}') sysconfig = readJavascriptConfig() yield """
""" yield """