#NEWLINE# def _get_mappings( self ) : #NEWLINE# #INDENT# mappings = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if self . mapping_file : #NEWLINE# #INDENT# fileobj = open ( self . mapping_file , 'U' ) #NEWLINE# try : #NEWLINE# #INDENT# ( method_map , options_map ) = parse_mapping ( fileobj ) #NEWLINE# for path in self . input_paths : #NEWLINE# #INDENT# mappings [ path ] = ( method_map , options_map ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# fileobj . close ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if getattr ( self . distribution , 'message_extractors' , None ) : #NEWLINE# #INDENT# message_extractors = self . distribution . message_extractors #NEWLINE# for ( path , mapping ) in message_extractors . items ( ) : #NEWLINE# #INDENT# if isinstance ( mapping , string_types ) : #NEWLINE# #INDENT# ( method_map , options_map ) = parse_mapping ( StringIO ( mapping ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( method_map , options_map ) = ( [ ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# for ( pattern , method , options ) in mapping : #NEWLINE# #INDENT# method_map . append ( ( pattern , method ) ) #NEWLINE# options_map [ pattern ] = ( options or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# mappings [ path ] = ( method_map , options_map ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for path in self . input_paths : #NEWLINE# #INDENT# mappings [ path ] = ( DEFAULT_MAPPING , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return mappings