[Reproducible-commits] [debbindiff] 07/19: Convert showttf to Command class

Jérémy Bobbio lunar at moszumanska.debian.org
Tue Mar 31 14:59:28 UTC 2015


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

lunar pushed a commit to branch pu/feed-diff
in repository debbindiff.

commit 3693b6723742b838c89eb5099d8a1bf3228c65ee
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Mon Mar 30 13:50:11 2015 +0200

    Convert showttf to Command class
---
 debbindiff/comparators/fonts.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/debbindiff/comparators/fonts.py b/debbindiff/comparators/fonts.py
index 1db81da..5481a1e 100644
--- a/debbindiff/comparators/fonts.py
+++ b/debbindiff/comparators/fonts.py
@@ -20,21 +20,21 @@
 import locale
 import subprocess
 from debbindiff import tool_required
-from debbindiff.comparators.utils import binary_fallback
+from debbindiff.comparators.utils import binary_fallback, Command
 from debbindiff.difference import Difference
 
 
- at tool_required('showttf')
-def show_ttf(path):
-    return subprocess.check_output(['showttf', path], shell=False,
-                                   stderr=subprocess.PIPE).decode('latin-1')
+class Showttf(Command):
+    @tool_required('showttf')
+    def cmdline(self):
+        return ['showttf', self.path]
 
+    def filter(self, line):
+        return line.decode('latin-1').encode('utf-8')
 
 @binary_fallback
 def compare_ttf_files(path1, path2, source=None):
-    ttf1 = show_ttf(path1)
-    ttf2 = show_ttf(path2)
-    difference = Difference.from_unicode(ttf1, ttf2, path1, path2, source='showttf')
+    difference = Difference.from_command(Showttf, path1, path2)
     if not difference:
         return []
     return [difference]

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



More information about the Reproducible-commits mailing list