#NEWLINE# def __init__( self , site ) : #NEWLINE# #INDENT# self . pending_threads = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . site = site #NEWLINE# self . GFK_LIST = [ ] #NEWLINE# self . kernel_startup ( site ) #NEWLINE# self . code_mtime = codetime ( ) #NEWLINE# self . memo_parser = Parser ( ) #NEWLINE# def url2html( parser , s ) : #NEWLINE# #INDENT# url_text = s . split ( None , 1 ) #NEWLINE# if ( len ( url_text ) == 1 ) : #NEWLINE# #INDENT# url = text = url_text [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( url , text ) = url_text #NEWLINE# #UNINDENT# return ( '<a href="%s" target="_blank">%s</a>' % ( url , text ) ) #NEWLINE# #UNINDENT# self . memo_parser . register_command ( 'url' , url2html ) #NEWLINE# if ( site . build_js_cache_on_startup is None ) : #NEWLINE# #INDENT# site . build_js_cache_on_startup = ( not ( settings . DEBUG or is_devserver ( ) ) ) #NEWLINE# #UNINDENT# for a in actors . actors_list : #NEWLINE# #INDENT# if ( a . get_welcome_messages is not None ) : #NEWLINE# #INDENT# site . add_welcome_handler ( a . get_welcome_messages ) #NEWLINE# #UNINDENT# #UNINDENT# pre_ui_build . send ( self ) #NEWLINE# self . html_renderer = HtmlRenderer ( self ) #NEWLINE# self . text_renderer = TextRenderer ( self ) #NEWLINE# self . reserved_names = [ getattr ( constants , n ) for n in constants . URL_PARAMS ] #NEWLINE# names = set ( ) #NEWLINE# for n in self . reserved_names : #NEWLINE# #INDENT# if ( n in names ) : #NEWLINE# #INDENT# raise Exception ( ( 'Duplicate reserved name %r' % n ) ) #NEWLINE# #UNINDENT# names . add ( n ) #NEWLINE# #UNINDENT# for p in site . installed_plugins : #NEWLINE# #INDENT# p . on_ui_init ( self ) #NEWLINE# #UNINDENT# ui = None #NEWLINE# if ( self . site . default_ui is not None ) : #NEWLINE# #INDENT# ui = self . site . plugins . resolve ( p . site . default_ui ) #NEWLINE# if ( ui is None ) : #NEWLINE# #INDENT# raise Exception ( ( 'Invalid value %r for `default_ui` (must be one of %s)' % ( self . site . default_ui , list ( self . site . plugins . keys ( ) ) ) ) ) #NEWLINE# #UNINDENT# ui . url_prefix = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for p in self . site . installed_plugins : #NEWLINE# #INDENT# if ( p . ui_handle_attr_name is not None ) : #NEWLINE# #INDENT# ui = p #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ui is not None ) : #NEWLINE# #INDENT# self . default_renderer = ui . renderer #NEWLINE# self . default_ui = ui #NEWLINE# #UNINDENT# post_ui_build . send ( self ) #NEWLINE# if ( self . default_ui is not None ) : #NEWLINE# #INDENT# for res in actors . actors_list : #NEWLINE# #INDENT# for ba in res . get_actions ( ) : #NEWLINE# #INDENT# if ( ba . action . params_layout is not None ) : #NEWLINE# #INDENT# ba . action . params_layout . get_layout_handle ( self . default_ui )