Commits

Anonymous committed 9c5cfbf

[svn] Fix some pylint errors.

Comments (0)

Files changed (4)

pygments/lexer.py

     #: current one.
     tokens = {}
 
+    #: Processed tokens dict. This is filled by the metaclass.
+    _tokens = {}
+
     def get_tokens_unprocessed(self, text, stack=['root']):
         """
         Split ``text`` into (tokentype, text) pairs.

pygments/lexers/__init__.py

-# -*- coding: utf-8 -*-
++# -*- coding: utf-8 -*-
 """
     pygments.lexers
     ~~~~~~~~~~~~~~~
     for cls in find_plugin_lexers():
         for filename in cls.filenames:
             if fnmatch.fnmatch(_fn, filename):
-                return lexer(**options)
+                return cls(**options)
     raise ValueError('no lexer for filename %r found' % _fn)
 
 
             return _lexer_cache[name](**options)
     for cls in find_plugin_lexers():
         if _mime in cls.mimetypes:
-            return lexer(**options)
+            return cls(**options)
     raise ValueError('no lexer for mimetype %r found' % _mime)
 
 
     #     better guess_lexer_for_filename function.
     best_lexer = [0.0, None]
     for lexer in _iter_lexerclasses():
-        rv = lexer.analyse_text(text)
+        rv = lexer.analyse_text(_text)
         if rv == 1.0:
             return lexer(**options)
         if rv > best_lexer[0]:

pygments/lexers/templates.py

 from pygments.lexer import \
      Lexer, DelegatingLexer, RegexLexer, do_insertions, bygroups, \
      include, using
-from pygments.token import \
+from pygments.token import Error, \
      Text, Comment, Operator, Keyword, Name, String, Number, Other
 from pygments.util import html_doctype_matches, looks_like_xml
 

pygments/style.py

         }
 
     def list_styles(cls):
-        return list(self)
+        return list(cls)
 
     def __iter__(cls):
         for token in cls._styles:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.