parameters: (self, config)
return_statement: return result
docstring: Configure a formatter from a dictionary.
docstring_summary: Configure a formatter from a dictionary.
docstring_tokens: Configure a formatter from a dictionary .
function: def configure_formatter(self, config):
          """Configure a formatter from a dictionary."""
          if '()' in config:
              factory = config['()'] # for use in exception handler
              try:
                  result = self.configure_custom(config)
              except TypeError, te:
                  if "'format'" not in str(te):
                      raise
                  #Name of parameter changed from fmt to format.
                  #Retry with old name.
                  #This is so that code can be used with older Python versions
                  #(e.g. by Django)
                  config['fmt'] = config.pop('format')
                  config['()'] = factory
                  result = self.configure_custom(config)
          else:
              fmt = config.get('format', None)
              dfmt = config.get('datefmt', None)
              result = logging.Formatter(fmt, dfmt)
          return result
function_tokens: def configure_formatter ( self , config ) : if '()' in config : factory = config [ '()' ] # for use in exception handler try : result = self . configure_custom ( config ) except TypeError , te : if "'format'" not in str ( te ) : raise #Name of parameter changed from fmt to format. #Retry with old name. #This is so that code can be used with older Python versions #(e.g. by Django) config [ 'fmt' ] = config . pop ( 'format' ) config [ '()' ] = factory result = self . configure_custom ( config ) else : fmt = config . get ( 'format' , None ) dfmt = config . get ( 'datefmt' , None ) result = logging . Formatter ( fmt , dfmt ) return result