Skip to content

Commit

Permalink
Remove programoutput_use_ansi.
Browse files Browse the repository at this point in the history
The sphinxcontrib.ansi extension has been pulled from PyPI.
  • Loading branch information
jamadden committed Mar 15, 2017
1 parent e482d85 commit 0485ff2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

- 100% test coverage.

- Remove support for ``programoutput_use_ansi``. The
``sphinxcontrib.ansi`` extension is no longer available on PyPI.

0.8 (Oct 12, 2012)
==================

Expand Down
12 changes: 5 additions & 7 deletions src/sphinxcontrib/programoutput/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,11 @@ def run_programs(app, doctree):
The program output is retrieved from the cache in
``app.env.programoutput_cache``.
"""
if app.config.programoutput_use_ansi:
# enable ANSI support, if requested by config
from sphinxcontrib.ansi import ansi_literal_block
node_class = ansi_literal_block
else:
node_class = nodes.literal_block
# The node_class used to be switchable to `sphinxcontrib.ansi.ansi_literal_block`
# if `app.config.programoutput_use_ansi` was set. But sphinxcontrib.ansi
# is no longer available on PyPI, so we can't test that. And if we can't test it,
# we can't support it.
node_class = nodes.literal_block

cache = app.env.programoutput_cache

Expand Down Expand Up @@ -254,7 +253,6 @@ def init_cache(app):


def setup(app):
app.add_config_value('programoutput_use_ansi', False, 'env')
app.add_config_value('programoutput_prompt_template',
'$ {command}\n{output}', 'env')
app.add_directive('program-output', ProgramOutputDirective)
Expand Down
1 change: 0 additions & 1 deletion src/sphinxcontrib/programoutput/tests/test_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def test_command_non_default_prompt(self):
self.assert_output(self.doctree, '>> echo spam\n<< spam')
self.assert_cache(self.app, 'echo spam', 'spam')


@with_content("""\
.. program-output:: echo spam
:extraargs: with eggs""")
Expand Down

0 comments on commit 0485ff2

Please sign in to comment.