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)
78 # flower.py -- python flower lib
80 # source file of the GNU LilyPond music typesetter
82 # (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
86 """silly wrapper for Python file object."""
87 def __init__ (self,nm, mode='r'):
89 self.file_ = open (nm, mode);
91 self.file_ = sys.stdout
93 self.file_ = sys.stdin
97 l= self.file_.readline ();
101 def write (self, str):
102 self.file_.write (str)
120 def my_find(patterns, dir = os.curdir):
123 names = os.listdir(dir)
128 if name in (os.curdir, os.pardir):
130 fullname = os.path.join(dir, name)
132 if fnmatch.fnmatch(name, pat):
133 list.append(fullname)
134 if os.path.isdir(fullname) and not os.path.islink(fullname):
136 if fnmatch.fnmatch(name, p):
137 if _debug: print "skip", `fullname`
140 if _debug: print "descend into", `fullname`
141 found = my_find(patterns, fullname)
146 def multiple_find(pats, dirnames):
147 from find import find
150 l = l + my_find(pats, d)