7 you change something on a builtin formatter defintion, run this script from |
7 you change something on a builtin formatter defintion, run this script from |
8 the formatters folder to update it. |
8 the formatters folder to update it. |
9 |
9 |
10 Do not alter the FORMATTERS dictionary by hand. |
10 Do not alter the FORMATTERS dictionary by hand. |
11 |
11 |
12 :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. |
12 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. |
13 :license: BSD, see LICENSE for details. |
13 :license: BSD, see LICENSE for details. |
14 """ |
14 """ |
15 |
|
16 from pygments.util import docstring_headline |
|
17 |
15 |
18 # start |
16 # start |
19 from pygments.formatters.bbcode import BBCodeFormatter |
17 from pygments.formatters.bbcode import BBCodeFormatter |
20 from pygments.formatters.html import HtmlFormatter |
18 from pygments.formatters.html import HtmlFormatter |
21 from pygments.formatters.img import BmpImageFormatter |
19 from pygments.formatters.img import BmpImageFormatter |
52 |
50 |
53 # lookup formatters |
51 # lookup formatters |
54 found_formatters = [] |
52 found_formatters = [] |
55 imports = [] |
53 imports = [] |
56 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..')) |
54 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..')) |
|
55 from pygments.util import docstring_headline |
|
56 |
57 for filename in os.listdir('.'): |
57 for filename in os.listdir('.'): |
58 if filename.endswith('.py') and not filename.startswith('_'): |
58 if filename.endswith('.py') and not filename.startswith('_'): |
59 module_name = 'pygments.formatters.%s' % filename[:-3] |
59 module_name = 'pygments.formatters.%s' % filename[:-3] |
60 print(module_name) |
60 print(module_name) |
61 module = __import__(module_name, None, None, ['']) |
61 module = __import__(module_name, None, None, ['']) |