From: Tony Mack Date: Mon, 8 Apr 2013 00:44:28 +0000 (-0400) Subject: initial checkin X-Git-Tag: 1.0~246 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ebaad210b68934f5e40fe6d5d59fb9b2f1e76f6d;p=plstackapi.git initial checkin --- diff --git a/plstackapi/util/glob.py b/plstackapi/util/glob.py new file mode 100644 index 0000000..833ce35 --- /dev/null +++ b/plstackapi/util/glob.py @@ -0,0 +1,8 @@ +import os, fnmatch + +def recursive_glob(treeroot, pattern): + results = [] + for base, dirs, files in os.walk(treeroot): + goodfiles = fnmatch.filter(files, pattern) + results.extend(os.path.join(base, f) for f in goodfiles) + return results