#NEWLINE# def prepare( self , context ) : #NEWLINE# #INDENT# dom = context . request . host . partition ( ':' ) [ 0 ] #NEWLINE# parts = MAP . get ( dom , ( dom , 'en' ) ) #NEWLINE# context . domain = parts [ 0 ] #NEWLINE# context . lang = parts [ 1 ] #NEWLINE# context . otherlang = parts [ 2 ] #NEWLINE# context . croot = Asset . objects . nearest ( ( '/' + context . domain ) ) #NEWLINE# context . D = partial ( D_ , lang = parts [ 1 ] ) #NEWLINE# if context . croot : #NEWLINE# #INDENT# context . theme = load ( ( context . croot . properties . theme + ':page' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# context . theme = load ( 'web.theme.bootstrap.base:page' ) #NEWLINE# #UNINDENT# log . info ( 'Prepared context.' , extra = dict ( domain = [ dom , context . domain ] , lang = self . lang , root = repr ( context . croot ) , theme = repr ( context . theme ) ) )