#NEWLINE# def __new__( mcs , name , bases , attrs ) : #NEWLINE# #INDENT# orm = re . match ( 'architect.orms.(\\w+).features' , attrs . get ( '__module__' , '' ) ) #NEWLINE# if ( orm is not None ) : #NEWLINE# #INDENT# attrs [ 'orm' ] = orm . group ( 1 ) #NEWLINE# mcs . orms . append ( orm . group ( 1 ) ) #NEWLINE# #UNINDENT# feature_cls = super ( Registrar , mcs ) . __new__ ( mcs , name , bases , attrs ) #NEWLINE# orms = [ mod_name for ( _ , mod_name , is_pkg ) in pkgutil . iter_modules ( [ os . path . dirname ( __file__ ) ] ) if is_pkg ] #NEWLINE# if ( feature_cls . orm is None ) : #NEWLINE# #INDENT# return feature_cls #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( feature_cls . orm not in orms ) : #NEWLINE# #INDENT# raise ORMError ( current = feature_cls . orm , model = name , allowed = orms ) #NEWLINE# #UNINDENT# #UNINDENT# registry . setdefault ( feature_cls . orm , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) [ feature_cls . name ] = feature_cls #NEWLINE# return feature_cls