#NEWLINE# def get_parsers( parsers_path ) : #NEWLINE# #INDENT# parsers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for component_directory in parsers_path . split ( os . path . pathsep ) : #NEWLINE# #INDENT# sys . path . insert ( 0 , component_directory ) #NEWLINE# components_list = glob . glob ( ( component_directory + '/*.py' ) ) #NEWLINE# for component_file in components_list : #NEWLINE# #INDENT# component = os . path . splitext ( os . path . basename ( component_file ) ) [ 0 ] #NEWLINE# try : #NEWLINE# #INDENT# current_module = importlib . import_module ( component ) #NEWLINE# for name in dir ( current_module ) : #NEWLINE# #INDENT# if ( not name . startswith ( '_' ) ) : #NEWLINE# #INDENT# obj = getattr ( current_module , name ) #NEWLINE# try : #NEWLINE# #INDENT# if ( ( obj != PythonectInputFileFormatParser ) and issubclass ( obj , PythonectInputFileFormatParser ) ) : #NEWLINE# #INDENT# for ext in obj . FILE_EXTS : #NEWLINE# #INDENT# parsers [ ext ] = obj ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except TypeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return current_module