[diffoscope] 06/12: Extend hiding metadata to md and rst outputs.

Maria Glukhova siamezzze-guest at moszumanska.debian.org
Wed Mar 8 15:59:09 CET 2017


This is an automated email from the git hooks/post-receive script.

siamezzze-guest pushed a commit to branch siamezzze/hide-profiles-experiment
in repository diffoscope.

commit c170ce0de13b22898b6f3a4a20e260694265037a
Author: Maria Glukhova <siamezzze at gmail.com>
Date:   Tue Feb 7 03:38:26 2017 +0200

    Extend hiding metadata to md and rst outputs.
---
 diffoscope/presenters/markdown.py         | 5 +++++
 diffoscope/presenters/restructuredtext.py | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/diffoscope/presenters/markdown.py b/diffoscope/presenters/markdown.py
index dec9037..34ffc46 100644
--- a/diffoscope/presenters/markdown.py
+++ b/diffoscope/presenters/markdown.py
@@ -19,6 +19,8 @@
 
 from .utils import Presenter
 
+from diffoscope.config import Config
+
 
 class MarkdownTextPresenter(Presenter):
     def __init__(self, print_func):
@@ -26,6 +28,9 @@ class MarkdownTextPresenter(Presenter):
         super().__init__()
 
     def visit_difference(self, difference):
+        if Config().hide_profile is not None and \
+                        difference.source1 in Config().hide_profile:
+            return
         if difference.source1 == difference.source2:
             self.title(difference.source1)
         else:
diff --git a/diffoscope/presenters/restructuredtext.py b/diffoscope/presenters/restructuredtext.py
index 380fbce..60becdd 100644
--- a/diffoscope/presenters/restructuredtext.py
+++ b/diffoscope/presenters/restructuredtext.py
@@ -19,6 +19,8 @@
 
 from .utils import Presenter
 
+from diffoscope.config import Config
+
 
 class RestructuredTextPresenter(Presenter):
     TITLE_CHARS = '=-`:.\'"~^_*+#'
@@ -28,6 +30,9 @@ class RestructuredTextPresenter(Presenter):
         super().__init__()
 
     def visit_difference(self, difference):
+        if Config().hide_profile is not None and \
+                        difference.source1 in Config().hide_profile:
+            return
         if difference.source1 == difference.source2:
             self.title(difference.source1)
         else:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list