From ebaad210b68934f5e40fe6d5d59fb9b2f1e76f6d Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Sun, 7 Apr 2013 20:44:28 -0400 Subject: [PATCH] initial checkin --- plstackapi/util/glob.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 plstackapi/util/glob.py 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 -- 2.47.0