summaryrefslogtreecommitdiff
path: root/sphinx/highlighting.py
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2008-04-28 13:22:14 +0000
committerArmin Ronacher <armin.ronacher@active-4.com>2008-04-28 13:22:14 +0000
commit2e96cea026f805dfee9a98e7cbaac8ec0993a51d (patch)
tree93efe0dcc5e489dbcb1e28dc75df44e70fa296a7 /sphinx/highlighting.py
parentdf27e62743ca75bfdee6f98843cbb77c96ba9d9b (diff)
downloadsphinx-git-2e96cea026f805dfee9a98e7cbaac8ec0993a51d.tar.gz
pygments_style can be an import path now
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r--sphinx/highlighting.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
index ba5091735..a70d8e1e0 100644
--- a/sphinx/highlighting.py
+++ b/sphinx/highlighting.py
@@ -87,10 +87,11 @@ class PygmentsBridge(object):
return
if stylename == 'sphinx':
style = SphinxStyle
- elif isinstance(stylename, basestring):
- style = get_style_by_name(stylename)
+ elif '.' in stylename:
+ module, stylename = stylename.rsplit('.', 1)
+ style = getattr(__import__(module, None, None, ['']), stylename)
else:
- style = stylename
+ style = get_style_by_name(stylename)
self.hfmter = {False: HtmlFormatter(style=style),
True: HtmlFormatter(style=style, linenos=True)}
self.lfmter = {False: LatexFormatter(style=style),