geopython / MetaSearch

*** We have moved! MetaSearch is now a core QGIS plugin! (2014-11-30). See QGIS repository
https://hub.qgis.org/wiki/quantum-gis/MetaSearch
Other
4 stars 12 forks source link

replace pygments highlighting with QScintilla #32

Closed tomkralidis closed 9 years ago

tomkralidis commented 10 years ago

As suggested by @alexbruy, since the latter is part of QGIS core, replace pygments syntax highlighting funcitonality (contained to MetaSearch.util.highlight_xml) with something just as simple, and remove the pygments dependency and bundling for plugin.

tomkralidis commented 10 years ago

sample:

import sys
from PyQt4.QtGui import QApplication
from PyQt4 import QtCore, QtGui
from PyQt4.Qsci import QsciScintilla, QsciScintillaBase, QsciLexerXML

if __name__ == "__main__":
    app = QApplication(sys.argv)
    editor = QsciScintilla()
    ## Choose a lexer
    editor.setLexer(QsciLexerXML())
    ## Render on screen
    editor.show()

    xml = '''
    <body>
        <title id="5">foo</title>
    </body>'''
    ## Show this file in the editor
    editor.setText(xml)
    sys.exit(app.exec_())
tomkralidis commented 9 years ago

As per #62 moved to http://hub.qgis.org/issues/11731