original_docstring:  Returns a QTextCharFormat for token by reading a Pygments style.
              
docstring: Returns a QTextCharFormat for token by reading a Pygments style.
docstring_tokens: Returns a QTextCharFormat for token by reading a Pygments style .
code: def _get_format_from_style(self, token, style):
              """ Returns a QTextCharFormat for token by reading a Pygments style.
              """
              result = QtGui.QTextCharFormat()
              #
              # EKR: handle missing tokens.
              try:
                  data = style.style_for_token(token).items()
              except KeyError as err:
                  key = repr(err)
                  if key not in self.key_error_d:
                      self.key_error_d[key] = True
                      g.trace(err)
                  return result
              for key, value in data:
                  if value:
                      if key == 'color':
                          result.setForeground(self._get_brush(value))
                      elif key == 'bgcolor':
                          result.setBackground(self._get_brush(value))
                      elif key == 'bold':
                          result.setFontWeight(QtGui.QFont.Bold)
                      elif key == 'italic':
                          result.setFontItalic(True)
                      elif key == 'underline':
                          result.setUnderlineStyle(QtGui.QTextCharFormat.SingleUnderline)
                      elif key == 'sans':
                          result.setFontStyleHint(QtGui.QFont.SansSerif)
                      elif key == 'roman':
                          result.setFontStyleHint(QtGui.QFont.Times)
                      elif key == 'mono':
                          result.setFontStyleHint(QtGui.QFont.TypeWriter)
              return result
code_tokens: def _get_format_from_style ( self , token , style ) : result = QtGui . QTextCharFormat ( ) try : data = style . style_for_token ( token ) . items ( ) except KeyError as err : key = repr ( err ) if key not in self . key_error_d : self . key_error_d [ key ] = True g . trace ( err ) return result for key , value in data : if value : if key == 'color' : result . setForeground ( self . _get_brush ( value ) ) elif key == 'bgcolor' : result . setBackground ( self . _get_brush ( value ) ) elif key == 'bold' : result . setFontWeight ( QtGui . QFont . Bold ) elif key == 'italic' : result . setFontItalic ( True ) elif key == 'underline' : result . setUnderlineStyle ( QtGui . QTextCharFormat . SingleUnderline ) elif key == 'sans' : result . setFontStyleHint ( QtGui . QFont . SansSerif ) elif key == 'roman' : result . setFontStyleHint ( QtGui . QFont . Times ) elif key == 'mono' : result . setFontStyleHint ( QtGui . QFont . TypeWriter ) return result
short_docstring: Returns a QTextCharFormat for token by reading a Pygments style.
short_docstring_tokens: Returns a QTextCharFormat for token by reading a Pygments style .
comment: """ Returns a QTextCharFormat for token by reading a Pygments style.
              """$SEP$#$SEP$# EKR: handle missing tokens.