#from sys import stderr def main(arguments={}, path='', *args, **kwargs): language = path.startswith('/en/') and 'en' or 'nl' query = arguments.get('query', [''])[0] nlPath = '/'.join(['nl'] + path.split('/')[2:]) + '?' + urlencode(arguments) enPath = '/'.join(['en'] + path.split('/')[2:]) + '?' + urlencode(arguments) drilldown=''; if 'drilldown' in arguments: for value in arguments['drilldown']: drilldown += '&drilldown='+value yield """
NL | EN
""" % ( drilldown, query, {'nl':'Zoeken', 'en':'Search'}[language],nlPath, enPath)