From c78c6e9844a23144ce7fa29afbf57b74587bfcd0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 21 Jan 2012 19:55:16 -0500 Subject: [PATCH] Cleanup --- test/shaping/hb-manifest-read | 2 +- test/shaping/hb_test_tools.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/shaping/hb-manifest-read b/test/shaping/hb-manifest-read index bfca2c0dc..754e49140 100755 --- a/test/shaping/hb-manifest-read +++ b/test/shaping/hb-manifest-read @@ -2,4 +2,4 @@ from hb_test_tools import * -UtilMains.process_multiple_args (Manifest.print_to_stdout, mnemonic="DIR") +UtilMains.process_multiple_args (UtilMains.filter_printer_function (Manifest.read), mnemonic="DIR") diff --git a/test/shaping/hb_test_tools.py b/test/shaping/hb_test_tools.py index 7ff7a0255..d53aa4a3d 100644 --- a/test/shaping/hb_test_tools.py +++ b/test/shaping/hb_test_tools.py @@ -116,6 +116,14 @@ class ShapeFilters: class UtilMains: + @staticmethod + def filter_printer_function (callback): + def printer (f): + for line in callback (f): + print line + return printer + + @staticmethod def process_multiple_files (callback, mnemonic = "FILE"): @@ -263,11 +271,6 @@ class Manifest: else: yield s - @staticmethod - def print_to_stdout (s, strict = True): - for f in Manifest.read (s, strict=strict): - print f - @staticmethod def update_recursive (s):