#NEWLINE# def _load_all_extensions_from_path( self , path ) : #NEWLINE# #INDENT# for f in sorted ( os . listdir ( path ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# LOG . debug ( 'Loading extension file: %s' , f ) #NEWLINE# ( mod_name , file_ext ) = os . path . splitext ( os . path . split ( ext_name ) [ ( - 1 ) ] ) #NEWLINE# ext_path = os . path . join ( path , f ) #NEWLINE# if ( ( file_ext . lower ( ) == '.py' ) and ( not mod_name . startswith ( '_' ) ) ) : #NEWLINE# #INDENT# mod = imp . load_source ( mod_name , ext_path ) #NEWLINE# ext_name = ( mod_name [ 0 ] . upper ( ) + mod_name [ 1 : ] ) #NEWLINE# new_ext_class = getattr ( mod , ext_name , None ) #NEWLINE# if ( not new_ext_class ) : #NEWLINE# #INDENT# LOG . warning ( _LW ( 'Did not find expected name "%(ext_name)s" in %(file)s' ) , { #NEWLINE# #INDENT# 'ext_name' : ext_name , #NEWLINE# 'file' : ext_path , #NEWLINE# #UNINDENT# } ) #NEWLINE# continue #NEWLINE# #UNINDENT# new_ext = new_ext_class ( ) #NEWLINE# self . add_extension ( new_ext ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception as exception : #NEWLINE# #INDENT# LOG . warning ( _LW ( "Extension file %(f)s wasn't loaded due to %(exception)s" ) , { #NEWLINE# #INDENT# 'f' : f , #NEWLINE# 'exception' : exception , #NEWLINE# #UNINDENT# } )