4 # flower.py -- python flower lib
6 # source file of the GNU LilyPond music typesetter
8 # (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
15 """silly wrapper for Python file object."""
16 def __init__ (self,nm, mode='r'):
18 self.file_ = open (nm, mode);
20 self.file_ = sys.stdout
22 self.file_ = sys.stdin
26 l= self.file_.readline ();
30 def write (self, str):
31 self.file_.write (str)
49 def my_find(patterns, dir = os.curdir):
51 names = os.listdir(dir)
54 if name in (os.curdir, os.pardir):
56 fullname = os.path.join(dir, name)
58 if fnmatch.fnmatch(name, pat):
60 if os.path.isdir(fullname) and not os.path.islink(fullname):
62 if fnmatch.fnmatch(name, p):
63 if _debug: print "skip", `fullname`
66 if _debug: print "descend into", `fullname`
67 found = my_find(patterns, fullname)
73 def multiple_find(pats, dirnames):
77 l = l + my_find(pats, d)
80 def file_exist_b(name):