3 pygments.lexers |
3 pygments.lexers |
4 ~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~ |
5 |
5 |
6 Pygments lexers. |
6 Pygments lexers. |
7 |
7 |
8 :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
|
11 |
11 import sys |
12 import sys |
|
13 import types |
12 import fnmatch |
14 import fnmatch |
13 import types |
|
14 from os.path import basename |
15 from os.path import basename |
15 |
|
16 try: |
|
17 set |
|
18 except NameError: |
|
19 from sets import Set as set |
|
20 |
16 |
21 from pygments.lexers._mapping import LEXERS |
17 from pygments.lexers._mapping import LEXERS |
22 from pygments.plugin import find_plugin_lexers |
18 from pygments.plugin import find_plugin_lexers |
23 from pygments.util import ClassNotFound, bytes |
19 from pygments.util import ClassNotFound, bytes |
24 |
20 |
221 setattr(self, name, cls) |
217 setattr(self, name, cls) |
222 return cls |
218 return cls |
223 raise AttributeError(name) |
219 raise AttributeError(name) |
224 |
220 |
225 |
221 |
226 import sys |
|
227 oldmod = sys.modules['pygments.lexers'] |
222 oldmod = sys.modules['pygments.lexers'] |
228 newmod = _automodule('pygments.lexers') |
223 newmod = _automodule('pygments.lexers') |
229 newmod.__dict__.update(oldmod.__dict__) |
224 newmod.__dict__.update(oldmod.__dict__) |
230 sys.modules['pygments.lexers'] = newmod |
225 sys.modules['pygments.lexers'] = newmod |
231 del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types |
226 del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types |