diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2008-04-28 13:22:14 +0000 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2008-04-28 13:22:14 +0000 |
commit | 2e96cea026f805dfee9a98e7cbaac8ec0993a51d (patch) | |
tree | 93efe0dcc5e489dbcb1e28dc75df44e70fa296a7 /sphinx/highlighting.py | |
parent | df27e62743ca75bfdee6f98843cbb77c96ba9d9b (diff) | |
download | sphinx-git-2e96cea026f805dfee9a98e7cbaac8ec0993a51d.tar.gz |
pygments_style can be an import path now
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r-- | sphinx/highlighting.py | 7 |
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), |