From b4e19174fff6f16e93322f79dc8f2e59935705f4 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 12 Mar 2011 18:03:10 +0100 Subject: [PATCH] Imagine pseudocode that handles files and dirs --- script.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/script.py b/script.py index 334083e..b1bd1f7 100755 --- a/script.py +++ b/script.py @@ -5,6 +5,24 @@ import os import lib +# the interpolate method should take a steps and button argument!!! +# maybe it does... + +if font1 and font2 are directories: + we are done! +elif font1 is file: + recurse into font2 +elif font2 is file: + recurse into font1 + +def font_times_directory(font0, directory): + for dirpath, dirnames, filenames in os.walk(directory): + for font1 in filenames: + + font_times_my_font = lib.InterpolateFonts(os.path.join(dirpath, font0), os.path.join(dirpath, font1), options.button, options.steps) + font_times_my_font.font_info() + font_times_my_font.interpolate() + def for_every_file(top1, top2, my_function): '''recursively descend the directory tree rooted at top, calling the my_function function for each regular file''' -- 2.11.4.GIT