1
# -*- coding: utf-8 -*-
6
Contains built-in styles.
8
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
9
:license: BSD, see LICENSE for details.
12
from pygments.plugin import find_plugin_styles
13
from pygments.util import ClassNotFound
16
#: Maps style names to 'submodule::classname'.
18
'default': 'default::DefaultStyle',
19
'emacs': 'emacs::EmacsStyle',
20
'friendly': 'friendly::FriendlyStyle',
21
'colorful': 'colorful::ColorfulStyle',
22
'autumn': 'autumn::AutumnStyle',
23
'murphy': 'murphy::MurphyStyle',
24
'manni': 'manni::ManniStyle',
25
'monokai': 'monokai::MonokaiStyle',
26
'perldoc': 'perldoc::PerldocStyle',
27
'pastie': 'pastie::PastieStyle',
28
'borland': 'borland::BorlandStyle',
29
'trac': 'trac::TracStyle',
30
'native': 'native::NativeStyle',
31
'fruity': 'fruity::FruityStyle',
32
'bw': 'bw::BlackWhiteStyle',
33
'vs': 'vs::VisualStudioStyle',
34
'tango': 'tango::TangoStyle',
38
def get_style_by_name(name):
40
mod, cls = STYLE_MAP[name].split('::')
43
for found_name, style in find_plugin_styles():
44
if name == found_name:
46
# perhaps it got dropped into our styles package
49
cls = name.title() + "Style"
52
mod = __import__('pygments.styles.' + mod, None, None, [cls])
54
raise ClassNotFound("Could not find style module %r" % mod +
55
(builtin and ", though it should be builtin") + ".")
57
return getattr(mod, cls)
58
except AttributeError:
59
raise ClassNotFound("Could not find style class %r in style module." % cls)
63
"""Return an generator for all styles by name,
64
both builtin and plugin."""
65
for name in STYLE_MAP:
67
for name, _ in find_plugin_styles():