Refactor to /opt/planetstack, final tweaks to make sure planetstack can run in non...
[plstackapi.git] / planetstack / util / glob.py
diff --git a/planetstack/util/glob.py b/planetstack/util/glob.py
new file mode 100644 (file)
index 0000000..833ce35
--- /dev/null
@@ -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