#NEWLINE# def on_loaded( self , app ) : #NEWLINE# #INDENT# if ( app . callable . command == 'serve_static' ) : #NEWLINE# #INDENT# location = app . config [ 'STATIC_LOCATION' ] #NEWLINE# app . _handler = MediaRouter ( '' , location , default_suffix = 'html' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( app . config [ 'DEFAULT_CONTENT_TYPE' ] == 'text/html' ) : #NEWLINE# #INDENT# app . cms = CMS ( app ) #NEWLINE# for content in html_contents ( app ) : #NEWLINE# #INDENT# app . cms . add_router ( content ) #NEWLINE# #UNINDENT# app . _handler . middleware . extend ( app . cms . middleware ( ) )