def getLocale(urlLocale, acptLang): if urlLocale in getSupportedLocales(): return urlLocale else: return determineLocale(acptLang)
def checkData(urlLocale, userLocale): if userLocale not in getSupportedLocales(): raise web.notfound() if urlLocale not in getSupportedLocales() and None: raise web.notfound()