Beispiel #1
0
 def __init__(self, parent=None):
     QsciLexerCustom.__init__(self, parent)
     self._styles = {
         0: 'Default',
         1: 'Function',
         }
     for key, value in self._styles.iteritems():
         setattr(self, value, key)
Beispiel #2
0
 def __init__(self, parent):
     QsciLexerCustom.__init__(self, parent)
     self._styles = {
         0: 'Default',
         1: 'Comment',
         2: 'Section',
         3: 'Key',
         4: 'Assignment',def defaultText(self,text):
    print text
         5: 'Value',
         }
Beispiel #3
0
 def __init__(self, parent):
     QsciLexerCustom.__init__(self, parent)
     self._styles = { 
         0: 'Default',
         1: 'FirstLevelTitle',
         2: 'SecundLevelTitle',
         3: 'Green',
         4: 'Digits'
         }
     for key,value in self._styles.iteritems():
         setattr(self, value, key)
Beispiel #4
0
 def __init__(self, parent):
     QsciLexerCustom.__init__(self, parent)
     self._styles = {
         0: 'Default',
         1: 'Comment_Start',
         2: 'Comment',
         3: 'Comment_End'
     }
     for key, value in self._styles.items():
         setattr(self, value, key)
     self._foldcompact = True
Beispiel #5
0
 def __init__(self, parent):
     QsciLexerCustom.__init__(self, parent)
     self._styles = {
         0: 'Default',
         1: 'FirstLevelTitle',
         2: 'SecundLevelTitle',
         3: 'Green',
         4: 'Digits'
     }
     for key, value in self._styles.iteritems():
         setattr(self, value, key)
Beispiel #6
0
    def __init__(self, parent=None):
        QsciLexerCustom.__init__(self, parent)

        self._styles = {
            0: 'Default',
            1: 'ErrorInfo',
            2: 'OutputInfo',
            3: 'ExitInfo',
            4: 'Start'
            }
        for key in self._styles:
            setattr(self, self._styles[key], key)
Beispiel #7
0
    def __init__(self, parent=None):
        QsciLexerCustom.__init__(self, parent)

        self._styles = {
            0: 'Default',
            1: 'NewText',
            2: 'DeletedText',
            3: 'ReplacedText',
            4: 'LineNumber'
        }
        for key in self._styles:
            setattr(self, self._styles[key], key)
Beispiel #8
0
    def __init__(self, parent=None):
        QsciLexerCustom.__init__(self, parent)
        self._styles = {
            0: 'Default',
            1: 'Keyword',
            2: 'Comment',
            3: 'Number',
            4: 'String',
        }

        for (k, v) in self._styles.iteritems():
            setattr(self, v, k)
Beispiel #9
0
    def __init__(self, parent=None):
        QsciLexerCustom.__init__(self, parent)

        self._styles = {
            0: 'Default',
            1: 'ErrorInfo',
            2: 'OutputInfo',
            3: 'ExitInfo',
            4: 'Start'
        }
        for key in self._styles:
            setattr(self, self._styles[key], key)
Beispiel #10
0
 def __init__(self, parent):
     QsciLexerCustom.__init__(self, parent)
     self._styles = {
         0: 'Default',
         1: 'Comment',
         2: 'Section',
         3: 'Key',
         4: 'Assignment',
         5: 'Value',
         }
     for key,value in self._styles.iteritems():
         setattr(self, value, key)
     self._foldcompact = True
Beispiel #11
0
 def defaultPaper(self, style):
     # Here we change the color of the background.
     # We want to colorize all the background of the line.
     # This is done by using the following method defaultEolFill() .
     if style in self.__comment:
         return QColor('#FFEECC')
     return QsciLexerCustom.defaultPaper(self, style)
Beispiel #12
0
 def defaultPaper(self, style):
     # Here we change the color of the background.
     # We want that colorize all the background of the line.
     # This is done by using the following method defaultEolFill() .
     if style == self.Comment or style == self.Comment_End or style == self.Comment_Start:
         return QColor('#FFEECC')
     return QsciLexerCustom.defaultPaper(self, style)
Beispiel #13
0
 def __init__(self, parent):
     QsciLexerCustom.__init__(self, parent)
     self._styles = {
         0: 'Default',
         1: 'MultiLinesComment_Start',
         2: 'MultiLinesComment',
         3: 'MultiLinesComment_End',
         4: 'SingleLineComment'
         }
     for key,value in self._styles.iteritems():
         setattr(self, value, key)
     self._foldcompact = True
     self.__comment = [self.MultiLinesComment,
                       self.MultiLinesComment_End,
                       self.MultiLinesComment_Start,
                       self.SingleLineComment]
Beispiel #14
0
 def defaultPaper(self, style):
     # Here we change the color of the background.
     # We want that colorize all the background of the line.
     # This is done by using the following method defaultEolFill() .
     if style == self.Comment or style == self.Comment_End or style == self.Comment_Start:
         return QColor("#FFEECC")
     return QsciLexerCustom.defaultPaper(self, style)
Beispiel #15
0
    def defaultColor(self, style):
        """QsciLexerCustom method implmentation. See QScintlla docs
        """
        pygStyle = self._getPygStyle(style)
        if not pygStyle or not pygStyle['color']:
            return QsciLexerCustom.defaultColor(self, style)

        return self._toQColor(pygStyle['color'])
Beispiel #16
0
    def defaultPaper(self, style):
# Here we change the color of the background.
# We want to colorize all the background of the line.
# This is done by using the following method defaultEolFill() .
        if style == self.SecundLevelTitle:
            return QColor('#FFFF99')
        elif style == self.Digits:
            return QColor('#FFCC66')

        return QsciLexerCustom.defaultPaper(self, style)
Beispiel #17
0
    def defaultFont(self, style):
        font = QsciLexerCustom.defaultFont(self, style)

        if style == self.FirstLevelTitle or style == self.SecundLevelTitle:
            font.setBold(True)
        elif style == self.Green:
            font.setBold(True)
            font.setUnderline(True)
            
        return font
Beispiel #18
0
    def defaultPaper(self, style):
        # Here we change the color of the background.
        # We want to colorize all the background of the line.
        # This is done by using the following method defaultEolFill() .
        if style == self.SecundLevelTitle:
            return QColor('#FFFF99')
        elif style == self.Digits:
            return QColor('#FFCC66')

        return QsciLexerCustom.defaultPaper(self, style)
Beispiel #19
0
    def defaultFont(self, style):
        font = QsciLexerCustom.defaultFont(self, style)

        if style == self.FirstLevelTitle or style == self.SecundLevelTitle:
            font.setBold(True)
        elif style == self.Green:
            font.setBold(True)
            font.setUnderline(True)

        return font
Beispiel #20
0
 def __init__(self, parent = None, language = None):
     """language is language name as recognized by pygments
     """
     QsciLexerCustom.__init__(self, parent)
     self._lexer = None
     self._tokenCache = None
     self._lastBusyId = -1
     
     self._language = 'Scheme'
     
     if parent is not None:
         self._lexer = self._guessLexer(parent.text())
     
     self._style = pygments.styles.get_style_by_name('default')
     
     self.TOKEN_TO_QSTYLE = dict([(token, self._getNextStyleId()) for token in pygments.token.STANDARD_TYPES])
     self.QSTYLE_TO_TOKEN = dict([(v, k) for k, v in self.TOKEN_TO_QSTYLE.items()])
     
     if parent is not None:
         parent.textChanged.connect(self._onTextChanged)
    def defaultFont(self, style):
#        if style in self.__comment:
#            if sys.platform in ('win32', 'cygwin'):
#                return QFont('Comic Sans MS', 9, QFont.Bold)
#            return QFont('Bitstream Vera Serif', 9, QFont.Bold)
#        return QsciLexerCustom.defaultFont(self, style)
        font = QsciLexerCustom.defaultFont(self, style)
        if style == self.Digits:
            font.setBold(True)
#        print 'defaultFont', style
        return font
Beispiel #22
0
 def defaultColor(self, style):
     if style == self.Default:
         return QtGui.QColor("#ffffff")
     elif style == self.ErrorInfo:
         return QtGui.QColor("#E6DB74")
     elif style == self.OutputInfo:
         return QtGui.QColor("#FFFFFF")
     elif style == self.ExitInfo:
         return QtGui.QColor("#3DA3EF")
     elif style == self.Start:
         return QtGui.QColor("#7FE22A")
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #23
0
 def defaultFont(self, style):
     if style == self.Default:
         return Global.getDefaultFont()
     elif style == self.NewText:
         return Global.getDefaultFont()
     elif style == self.DeletedText:
         return Global.getDefaultFont()
     elif style == self.ReplacedText:
         return Global.getDefaultFont()
     elif style == self.LineNumber:
         return Global.getDefaultFont()
     return QsciLexerCustom.defaultFont(self, style)
    def defaultColor(self, style):
#        print 'defaultColor', style
        if style == self.Default:
            return QColor('#000000')
        elif style in self.__comment:
            return QColor('#E5E5E5')
        elif style == self.Digits:
            print 'digit'
            return QColor('#A52A2A')
        elif style == self.from_and_for:
            return QColor('#0000FF')
        return QsciLexerCustom.defaultColor(self, style)
Beispiel #25
0
 def defaultColor(self, style):
     if style == self.Default:
         return QtGui.QColor('#ffffff')
     elif style == self.ErrorInfo:
         return QtGui.QColor('#E6DB74')
     elif style == self.OutputInfo:
         return QtGui.QColor('#FFFFFF')
     elif style == self.ExitInfo:
         return QtGui.QColor('#3DA3EF')
     elif style == self.Start:
         return QtGui.QColor('#7FE22A')
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #26
0
 def defaultColor(self, style):
     if style == self.Default:
         return QtGui.QColor('#ffffff')
     elif style == self.ErrorInfo:
         return QtGui.QColor('#E6DB74')
     elif style == self.OutputInfo:
         return QtGui.QColor('#FFFFFF')
     elif style == self.ExitInfo:
         return QtGui.QColor('#3DA3EF')
     elif style == self.Start:
         return QtGui.QColor('#7FE22A')
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #27
0
 def defaultFont(self, style):
     if style == self.Default:
         return Global.getDefaultFont()
     elif style == self.ErrorInfo:
         return Global.getDefaultFont()
     elif style == self.OutputInfo:
         return Global.getDefaultFont()
     elif style == self.ExitInfo:
         return Global.getDefaultFont()
     elif style == self.Start:
         return Global.getDefaultFont()
     return QsciLexerCustom.defaultFont(self, style)
Beispiel #28
0
 def defaultColor(self, style):
     if style == self.Default:
         return QColor('#000000')
     elif style == self.FirstLevelTitle:
         return QColor('#FF0000')
     elif style == self.SecundLevelTitle:
         return QColor('#0000FF')
     elif style == self.Green:
         return QColor('#00FF00')
     elif style == self.Digits:
         return QColor('#AAAAAA')
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #29
0
 def defaultColor(self, style):
     if style == self.Default:
         return QColor('#000000')
     elif style == self.FirstLevelTitle:
         return QColor('#FF0000')
     elif style == self.SecundLevelTitle:
         return QColor('#0000FF')
     elif style == self.Green:
         return QColor('#00FF00')
     elif style == self.Digits:
         return QColor('#AAAAAA')
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #30
0
 def defaultFont(self, style):
     if style == self.Default:
         return Global.getDefaultFont()
     elif style == self.ErrorInfo:
         return Global.getDefaultFont()
     elif style == self.OutputInfo:
         return Global.getDefaultFont()
     elif style == self.ExitInfo:
         return Global.getDefaultFont()
     elif style == self.Start:
         return Global.getDefaultFont()
     return QsciLexerCustom.defaultFont(self, style)
Beispiel #31
0
 def defaultFont(self, style):
     """QsciLexerCustom method implmentation. See QScintlla docs
     """
     font = QsciLexerCustom.defaultFont(self, style)
     
     pygStyle = self._getPygStyle(style)
     if not pygStyle:
         return font
     
     font.setBold(pygStyle['bold'])
     font.setItalic(pygStyle['italic'])
     font.setUnderline(pygStyle['underline'])
     return font
Beispiel #32
0
    def defaultColor(self, style):
        if style == self.Default:
            return QColor("#2e3436")
        elif style == self.Keyword:
            return QColor("#204a87")
        elif style == self.Comment:
            return QColor("#c00")
        elif style == self.Number:
            return QColor("#4e9a06")
        elif style == self.String:
            return QColor("#ce5c00")

        return QsciLexerCustom.defaultColor(self, style)
Beispiel #33
0
    def defaultColor(self, style):
        if style == self.Default:
            return QColor('#2e3436')
        elif style == self.Keyword:
            return QColor('#204a87')
        elif style == self.Comment:
            return QColor('#c00')
        elif style == self.Number:
            return QColor('#4e9a06')
        elif style == self.String:
            return QColor('#ce5c00')

        return QsciLexerCustom.defaultColor(self, style)
Beispiel #34
0
 def defaultColor(self, style):
     if style == self.Default:
         return QColor('#000000')
     elif style == self.Comment:
         return QColor('#A0A0A0')
     elif style == self.Section:
         return QColor('#CC6600')
     elif style == self.Key:
         return QColor('#0000CC')
     elif style == self.Assignment:
         return QColor('#CC0000')
     elif style == self.Value:
         return QColor('#00CC00')
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #35
0
 def defaultColor(self, style):
     if style == self.Default:
         return QColor('#000000')
     elif style == self.Comment:
         return QColor('#A0A0A0')
     elif style == self.Section:
         return QColor('#CC6600')
     elif style == self.Key:
         return QColor('#0000CC')
     elif style == self.Assignment:
         return QColor('#CC0000')
     elif style == self.Value:
         return QColor('#00CC00')
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #36
0
 def defaultColor(self, style):
     if style == self.Default:
         return QColor('#000000')
     elif style == self.Comment or style == self.Comment_End or style == self.Comment_Start:
         return QColor('#A0A0A0')
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #37
0
 def defaultFont(self, style):
     if style == self.Comment:
         if sys.platform in ('win32', 'cygwin'):
             return QFont('Comic Sans MS', 9)
         return QFont('Bitstream Vera Serif', 9)
     return QsciLexerCustom.defaultFont(self, style)
Beispiel #38
0
 def defaultEolFill(self, style):
     # This allowed to colorize all the background of a line.
     if style in self.__comment:
         return True
     return QsciLexerCustom.defaultEolFill(self, style)
Beispiel #39
0
 def defaultFont(self, style):
     if style in self.__comment:
         if sys.platform in ('win32', 'cygwin'):
             return QFont('Comic Sans MS', 9, QFont.Bold)
         return QFont('Bitstream Vera Serif', 9, QFont.Bold)
     return QsciLexerCustom.defaultFont(self, style)
Beispiel #40
0
 def defaultEolFill(self, style):
     if style == self.Section:
         return True
     return QsciLexerCustom.defaultEolFill(self, style)
Beispiel #41
0
 def defaultEolFill(self, ix):
     for i in self.styles:
         if i.style() == ix:
             return i.eolFill()
     return QsciLexerCustom.defaultEolFill(self, ix)
Beispiel #42
0
 def defaultPaper(self, ix):
     for i in self.styles:
         if i.style() == ix:
             return i.paper()
     return QsciLexerCustom.defaultPaper(self, ix)
Beispiel #43
0
 def defaultFont(self, ix):
     for i in self.styles:
         if i.style() == ix:
             return i.font()
     return QsciLexerCustom.defaultFont(self, ix)
Beispiel #44
0
 def defaultEolFill(self, style):
     # This allowed to colorize all the background of a line.
     if style == self.Comment or style == self.Comment_End or style == self.Comment_Start:
         return True
     return QsciLexerCustom.defaultEolFill(self, style)
Beispiel #45
0
 def defaultFont(self, style):
     if style == self.Comment:
         return QFont('Courier', 10, QFont.Light)
     elif style == self.Default:
         return QFont('Courier', 10, QFont.Normal)
     return QsciLexerCustom.defaultFont(self, style)
Beispiel #46
0
 def defaultPaper(self, style):
     if style == self.Section:
         return QColor('#FFEECC')
     return QsciLexerCustom.defaultPaper(self, style)
Beispiel #47
0
 def defaultEolFill(self, style):
     # This allowed to colorize all the background of a line.
     if style == self.SecundLevelTitle:
         return True
     return QsciLexerCustom.defaultEolFill(self, style)
Beispiel #48
0
 def defaultColor(self, style):
     if style == self.Default:
         return QColor('#000000')
     elif style in self.__comment:
         return QColor('#A0A0A0')
     return QsciLexerCustom.defaultColor(self, style)
Beispiel #49
0
    def defaultEolFill(self, style):
# This allowed to colorize all the background of a line.
        if style == self.SecundLevelTitle:
            return True
        return QsciLexerCustom.defaultEolFill(self, style)
Beispiel #50
0
 def defaultColor(self, style):
     if style == self.Default:
         return QColor('#000000')
     elif style == self.Comment:
         return QColor('#228B22')
     return QsciLexerCustom.defaultColor(self, style)