viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1. from PyQt4 import QtGui
  2.  
  3. class syntax_highlighter(QtGui.QSyntaxHighlighter):
  4. def __init__(self, parent):
  5. super(syntax_highlighter, self).__init__(parent)
  6.  
  7. def highlightBlock(self, text):
  8. if(len(text) >= 2):
  9. if((text[0] == "R") & (text[1] == ":") ):
  10. self.setFormat(0, 2,QtGui.QColor(0,0,255))
  11. intag = False
  12. bold_font = QtGui.QTextCharFormat()
  13. bold_font.setFontWeight(QtGui.QFont.Bold)
  14. for i in range(0, len(text)):
  15. if(text[i] == "["):
  16. intag = True
  17. self.setFormat(i, 1, QtGui.QColor(255,0,255))
  18. elif(intag):
  19. self.setFormat(i, 1, QtGui.QColor(255,0,255))
  20. self.setFormat(i, 1, bold_font)
  21. if(text[i] == "]"):
  22. intag = False
  23. self.setFormat(i, 1, QtGui.QColor(255,0,255))
  24.  
  25.  
  26.  
  27.  
  28.  
  29.