parameters: (self, outputs)
return_statement: return res
docstring: Postprocesses output and maps mime types to ones accepted by R.
docstring_summary: Postprocesses output and maps mime types to ones accepted by R.
docstring_tokens: Postprocesses output and maps mime types to ones accepted by R .
function: def postprocess_output(self, outputs):
          """
          Postprocesses output and maps mime types to ones accepted by R.
          """
          res = []
          for output in outputs:
            msg_type = output.output_type
            content = output
            out = NotebookNode(output_type = msg_type)
            if msg_type in ('display_data', 'execute_result'):
              for mime, data in content['data'].items():
                  try:
                      attr = self.MIME_MAP[mime]
                      if attr == 'text':
                        tmpval =  RClansiconv(data) 
                      else:
                        tmpval = data
                      setattr(out, attr, tmpval)
                  except KeyError:
                      raise NotImplementedError('unhandled mime type: %s' % mime)
            elif msg_type == 'stream':
                setattr(out, 'text', RClansiconv(content['text']))
            elif msg_type == 'error':
                setattr(out, 'html', RClansiconv('\n'.join(content['traceback']) + '\n'))
            else:
                if _debugging: logging.info('Unsupported: ' + msg_type)
                raise NotImplementedError('unhandled result: %s' % msg_type)
            if _debugging: logging.info('Sending: msg_type: [{}]; HTML: [{}]; TEXT: [{}]'.format(msg_type, out.get('html', ''), out.get('text', '') ))
            res.append(out)
          return res
function_tokens: def postprocess_output ( self , outputs ) : res = [ ] for output in outputs : msg_type = output . output_type content = output out = NotebookNode ( output_type = msg_type ) if msg_type in ( 'display_data' , 'execute_result' ) : for mime , data in content [ 'data' ] . items ( ) : try : attr = self . MIME_MAP [ mime ] if attr == 'text' : tmpval = RClansiconv ( data ) else : tmpval = data setattr ( out , attr , tmpval ) except KeyError : raise NotImplementedError ( 'unhandled mime type: %s' % mime ) elif msg_type == 'stream' : setattr ( out , 'text' , RClansiconv ( content [ 'text' ] ) ) elif msg_type == 'error' : setattr ( out , 'html' , RClansiconv ( '\n' . join ( content [ 'traceback' ] ) + '\n' ) ) else : if _debugging : logging . info ( 'Unsupported: ' + msg_type ) raise NotImplementedError ( 'unhandled result: %s' % msg_type ) if _debugging : logging . info ( 'Sending: msg_type: [{}]; HTML: [{}]; TEXT: [{}]' . format ( msg_type , out . get ( 'html' , '' ) , out . get ( 'text' , '' ) ) ) res . append ( out ) return res