From: fred Date: Sun, 24 Mar 2002 20:05:28 +0000 (+0000) Subject: lilypond-0.1.44 X-Git-Tag: release/1.5.59~3453 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1865db28f73e5ec16c0e9b0ff3eefc5fa296b820;p=lilypond.git lilypond-0.1.44 --- diff --git a/bin/flower.py b/bin/flower.py index 5625599e7a..c7af8dd307 100644 --- a/bin/flower.py +++ b/bin/flower.py @@ -33,3 +33,42 @@ class File: def __del__ (self): self.close (); + + +import fnmatch +import os + +_debug = 0 + +_prune = ['(*)'] + + +def my_find(patterns, dir = os.curdir): + list = [] + names = os.listdir(dir) + names.sort() + for name in names: + if name in (os.curdir, os.pardir): + continue + fullname = os.path.join(dir, name) + for pat in patterns: + if fnmatch.fnmatch(name, pat): + list.append(fullname) + if os.path.isdir(fullname) and not os.path.islink(fullname): + for p in _prune: + if fnmatch.fnmatch(name, p): + if _debug: print "skip", `fullname` + break + else: + if _debug: print "descend into", `fullname` + found = my_find(patterns, fullname) + if found: + list = list + found + return list + +def multiple_find(pats, dirnames): + from find import find + l = [] + for d in dirnames: + l = l + my_find(pats, d) + return l diff --git a/bin/lilypython.py b/bin/lilypython.py index 5b68b97739..a9055e5c27 100644 --- a/bin/lilypython.py +++ b/bin/lilypython.py @@ -13,6 +13,7 @@ import pwd import regex import regsub from string import * +from flower import * import sys import os import getopt diff --git a/bin/make-patch.py b/bin/make-patch.py index 207066d31a..047f8e37b7 100644 --- a/bin/make-patch.py +++ b/bin/make-patch.py @@ -61,44 +61,6 @@ usage \n\ Patches do not contain automatically generated files, \n\ i.e. you should rerun configure\n\n' -import fnmatch -import os - -_debug = 0 - -_prune = ['(*)'] - - -def my_find(patterns, dir = os.curdir): - list = [] - names = os.listdir(dir) - names.sort() - for name in names: - if name in (os.curdir, os.pardir): - continue - fullname = os.path.join(dir, name) - for pat in patterns: - if fnmatch.fnmatch(name, pat): - list.append(fullname) - if os.path.isdir(fullname) and not os.path.islink(fullname): - for p in _prune: - if fnmatch.fnmatch(name, p): - if _debug: print "skip", `fullname` - break - else: - if _debug: print "descend into", `fullname` - found = my_find(patterns, fullname) - if found: - list = list + found - return list - -def multiple_find(pats, dirnames): - from find import find - l = [] - for d in dirnames: - l = l + my_find(pats, d) - return l - pats = ['*.lsm', 'configure', '*.txt', 'lilypond.spec'] def remove_automatic(dirnames): files = []