Cleanup
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 22 Jan 2012 00:55:16 +0000 (19:55 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Sun, 22 Jan 2012 00:55:16 +0000 (19:55 -0500)
test/shaping/hb-manifest-read
test/shaping/hb_test_tools.py

index bfca2c0..754e491 100755 (executable)
@@ -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")
index 7ff7a02..d53aa4a 100644 (file)
@@ -117,6 +117,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"):
 
                if len (sys.argv) == 1:
@@ -264,11 +272,6 @@ class Manifest:
                        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):
 
                for dirpath, dirnames, filenames in os.walk (s, followlinks=True):