4 # flower.py -- python flower lib
6 # source file of the GNU LilyPond music typesetter
8 # (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
14 """silly wrapper for Python file object."""
15 def __init__ (self,nm, mode='r'):
17 self.file_ = open (nm, mode);
19 self.file_ = sys.stdout
21 self.file_ = sys.stdin
25 l= self.file_.readline ();
29 def write (self, str):
30 self.file_.write (str)
48 def my_find(patterns, dir = os.curdir):
50 names = os.listdir(dir)
53 if name in (os.curdir, os.pardir):
55 fullname = os.path.join(dir, name)
57 if fnmatch.fnmatch(name, pat):
59 if os.path.isdir(fullname) and not os.path.islink(fullname):
61 if fnmatch.fnmatch(name, p):
62 if _debug: print "skip", `fullname`
65 if _debug: print "descend into", `fullname`
66 found = my_find(patterns, fullname)
71 def multiple_find(pats, dirnames):
75 l = l + my_find(pats, d)
78 def file_exist_b(name):