Skip to content
Snippets Groups Projects
Commit 7479e160 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

presenters.text: Apply --max-report-size to --text reports. (Closes: #851147)


Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent 2003d090
No related branches found
No related tags found
No related merge requests found
......@@ -20,8 +20,9 @@
import re
from diffoscope.diff import color_unified_diff
from diffoscope.config import Config
from .utils import Presenter
from .utils import Presenter, create_limited_print_func, PrintLimitReached
class TextPresenter(Presenter):
......@@ -29,11 +30,20 @@ class TextPresenter(Presenter):
RE_PREFIX = re.compile(r'(^|\n)')
def __init__(self, print_func, color):
self.print_func = print_func
self.print_func = create_limited_print_func(
print_func,
Config().max_report_size,
)
self.color = color
super().__init__()
def start(self, difference):
try:
super().start(difference)
except PrintLimitReached:
self.print_func("Max output size reached.", force=True)
def visit_difference(self, difference):
if self.depth == 0:
self.output("--- {}".format(difference.source1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment