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)
80 # flower.py -- python flower lib
82 # source file of the GNU LilyPond music typesetter
84 # (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
88 """silly wrapper for Python file object."""
89 def __init__ (self,nm, mode='r'):
91 self.file_ = open (nm, mode);
93 self.file_ = sys.stdout
95 self.file_ = sys.stdin
99 l= self.file_.readline ();
103 def write (self, str):
104 self.file_.write (str)
122 def my_find(patterns, dir = os.curdir):
125 names = os.listdir(dir)
130 if name in (os.curdir, os.pardir):
132 fullname = os.path.join(dir, name)
134 if fnmatch.fnmatch(name, pat):
135 list.append(fullname)
136 if os.path.isdir(fullname) and not os.path.islink(fullname):
138 if fnmatch.fnmatch(name, p):
139 if _debug: print "skip", `fullname`
142 if _debug: print "descend into", `fullname`
143 found = my_find(patterns, fullname)
148 def multiple_find(pats, dirnames):
149 from find import find
152 l = l + my_find(pats, d)