#NEWLINE# def __new__( mcs , name , bases , cls_dict ) : #NEWLINE# #INDENT# 'Adds the wsgi_actions dictionary to the class.' #NEWLINE# actions = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# extensions = [ ] #NEWLINE# for base in bases : #NEWLINE# #INDENT# actions . update ( getattr ( base , 'wsgi_actions' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# for ( key , value ) in cls_dict . items ( ) : #NEWLINE# #INDENT# if ( not callable ( value ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if getattr ( value , 'wsgi_action' , None ) : #NEWLINE# #INDENT# actions [ value . wsgi_action ] = key #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if getattr ( value , 'wsgi_extends' , None ) : #NEWLINE# #INDENT# extensions . append ( value . wsgi_extends ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# cls_dict [ 'wsgi_actions' ] = actions #NEWLINE# cls_dict [ 'wsgi_extensions' ] = extensions #NEWLINE# return super ( ControllerMetaclass , mcs ) . __new__ ( mcs , name , bases , cls_dict )