Esempio n. 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)
Esempio n. 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',
         }
Esempio n. 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)
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 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]
Esempio n. 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)
Esempio n. 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'])
Esempio n. 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)
Esempio n. 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
Esempio n. 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)
Esempio n. 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
Esempio n. 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)
Esempio n. 21
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)
        font = QsciLexerCustom.defaultFont(self, style)
        if style == self.Digits:
            font.setBold(True)
#        print 'defaultFont', style
        return font
Esempio n. 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)
Esempio n. 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)
Esempio n. 24
0
    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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 40
0
 def defaultEolFill(self, style):
     if style == self.Section:
         return True
     return QsciLexerCustom.defaultEolFill(self, style)
Esempio n. 41
0
 def defaultEolFill(self, ix):
     for i in self.styles:
         if i.style() == ix:
             return i.eolFill()
     return QsciLexerCustom.defaultEolFill(self, ix)
Esempio n. 42
0
 def defaultPaper(self, ix):
     for i in self.styles:
         if i.style() == ix:
             return i.paper()
     return QsciLexerCustom.defaultPaper(self, ix)
Esempio n. 43
0
 def defaultFont(self, ix):
     for i in self.styles:
         if i.style() == ix:
             return i.font()
     return QsciLexerCustom.defaultFont(self, ix)
Esempio n. 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)
Esempio n. 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)
Esempio n. 46
0
 def defaultPaper(self, style):
     if style == self.Section:
         return QColor('#FFEECC')
     return QsciLexerCustom.defaultPaper(self, style)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)