Exemplo n.º 1
0
 def __init__(self, parent=None):
     """
     Constructor
     
     @param parent parent widget of this lexer
     """
     QsciLexerBatch.__init__(self, parent)
     Lexer.__init__(self)
     
     self.commentString = "REM "
Exemplo n.º 2
0
    def __init__(self, parent=None):
        """
        Constructor
        
        @param parent parent widget of this lexer
        """
        QsciLexerBatch.__init__(self, parent)
        Lexer.__init__(self)

        self.commentString = "REM "

        self.keywordSetDescriptions = [
            self.tr("Internal Commands"),
            self.tr("External Commands")
        ]
Exemplo n.º 3
0
 def defaultKeywords(self, kwSet):
     """
     Public method to get the default keywords.
     
     @param kwSet number of the keyword set (integer)
     @return string giving the keywords (string) or None
     """
     return QsciLexerBatch.keywords(self, kwSet)
Exemplo n.º 4
0
    def checkExtensionToHighlight(self, path, editor):
        _, extension = os.path.splitext(path)

        if extension == '.py':
            editor.setLexer(QsciLexerPython(self))
        elif extension == '.html':
            editor.setLexer(QsciLexerHTML(self))
        elif extension == '.java':
            editor.setLexer(QsciLexerJava(self))
        elif extension == '.cs':
            editor.setLexer(QsciLexerCSharp(self))
        elif extension == '.bat':
            editor.setLexer(QsciLexerBatch(self))