QScintilla/Lexers/LexerPygments.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2677
3d4277929fb3
parent 3011
18292228c724
child 3060
5883ce99ee12
--- a/QScintilla/Lexers/LexerPygments.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/QScintilla/Lexers/LexerPygments.py	Fri Oct 18 23:00:41 2013 +0200
@@ -10,7 +10,8 @@
 from __future__ import unicode_literals    # __IGNORE_WARNING__
 
 from pygments.token import Token
-from pygments.lexers import guess_lexer_for_filename, guess_lexer, find_lexer_class
+from pygments.lexers import guess_lexer_for_filename, guess_lexer, \
+    find_lexer_class
 from pygments.util import ClassNotFound
 
 from PyQt4.QtGui import QColor, QFont
@@ -307,7 +308,8 @@
         @param style style number (integer)
         @return font (QFont)
         """
-        if style in [PYGMENTS_COMMENT, PYGMENTS_PREPROCESSOR, PYGMENTS_MULTILINECOMMENT]:
+        if style in [PYGMENTS_COMMENT, PYGMENTS_PREPROCESSOR,
+                     PYGMENTS_MULTILINECOMMENT]:
             if Utilities.isWindowsPlatform():
                 f = QFont("Comic Sans MS", 9)
             else:
@@ -322,11 +324,12 @@
             else:
                 return QFont("Bitstream Vera Serif", 10)
         
-        if style in [PYGMENTS_KEYWORD, PYGMENTS_OPERATOR, PYGMENTS_WORD, PYGMENTS_BUILTIN,
-                     PYGMENTS_ATTRIBUTE, PYGMENTS_FUNCTION, PYGMENTS_CLASS,
-                     PYGMENTS_NAMESPACE, PYGMENTS_EXCEPTION, PYGMENTS_ENTITY,
-                     PYGMENTS_TAG, PYGMENTS_SCALAR, PYGMENTS_ESCAPE, PYGMENTS_HEADING,
-                     PYGMENTS_SUBHEADING, PYGMENTS_STRONG, PYGMENTS_PROMPT]:
+        if style in [PYGMENTS_KEYWORD, PYGMENTS_OPERATOR, PYGMENTS_WORD,
+                     PYGMENTS_BUILTIN, PYGMENTS_ATTRIBUTE, PYGMENTS_FUNCTION,
+                     PYGMENTS_CLASS, PYGMENTS_NAMESPACE, PYGMENTS_EXCEPTION,
+                     PYGMENTS_ENTITY, PYGMENTS_TAG, PYGMENTS_SCALAR,
+                     PYGMENTS_ESCAPE, PYGMENTS_HEADING, PYGMENTS_SUBHEADING,
+                     PYGMENTS_STRONG, PYGMENTS_PROMPT]:
             f = LexerContainer.defaultFont(self, style)
             f.setBold(True)
             return f
@@ -428,7 +431,8 @@
         self.__lexer = self.__guessLexer(text)
         
         cpos = 0
-        # adjust start position because pygments ignores empty line at start of text
+        # adjust start position because pygments ignores empty line at
+        # start of text
         for c in text:
             if c == "\n":
                 cpos += 1
@@ -457,6 +461,7 @@
         """
         Public method to check, if a style is a comment style.
         
+        @param style style to check (integer)
         @return flag indicating a comment style (boolean)
         """
         return style in [PYGMENTS_COMMENT]
@@ -465,11 +470,12 @@
         """
         Public method to check, if a style is a string style.
         
+        @param style style to check (integer)
         @return flag indicating a string style (boolean)
         """
         return style in [PYGMENTS_STRING, PYGMENTS_DOCSTRING, PYGMENTS_OTHER,
-                         PYGMENTS_HEADING, PYGMENTS_SUBHEADING, PYGMENTS_EMPHASIZE,
-                         PYGMENTS_STRONG]
+                         PYGMENTS_HEADING, PYGMENTS_SUBHEADING,
+                         PYGMENTS_EMPHASIZE, PYGMENTS_STRONG]
     
     def defaultKeywords(self, kwSet):
         """

eric ide

mercurial