Commits

gbrandl  committed 9c5cfbf

[svn] Fix some pylint errors.

  • Participants
  • Parent commits 5f27674
  • Branches trunk

Comments (0)

Files changed (4)

File 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.

File 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]:

File 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
 

File pygments/style.py

         }
 
     def list_styles(cls):
-        return list(self)
+        return list(cls)
 
     def __iter__(cls):
         for token in cls._styles: