4 # flower.py -- python flower lib
6 # source file of the GNU LilyPond music typesetter
8 # (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
12 """silly wrapper for Python file object."""
13 def __init__ (self,nm, mode='r'):
15 self.file_ = open (nm, mode);
17 self.file_ = sys.stdout
19 self.file_ = sys.stdin
23 l= self.file_.readline ();
27 def write (self, str):
28 self.file_.write (str)
46 def my_find(patterns, dir = os.curdir):
48 names = os.listdir(dir)
51 if name in (os.curdir, os.pardir):
53 fullname = os.path.join(dir, name)
55 if fnmatch.fnmatch(name, pat):
57 if os.path.isdir(fullname) and not os.path.islink(fullname):
59 if fnmatch.fnmatch(name, p):
60 if _debug: print "skip", `fullname`
63 if _debug: print "descend into", `fullname`
64 found = my_find(patterns, fullname)
69 def multiple_find(pats, dirnames):
73 l = l + my_find(pats, d)