aboutsummaryrefslogtreecommitdiff
path: root/scripts/build/glob_recursive.py
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-08-24 01:32:23 +0200
committer Hop311 <hop3114@gmail.com>2023-08-24 01:32:23 +0200
commitefa88c722fcb6c8fea7a86e1b3b8a83f1f59eb31 (patch)
tree0d64199bf4f19fabaaff083b35aa8625823d6c1e /scripts/build/glob_recursive.py
parent6f4a6c77c6f2613e65a403c3a2964d5041a538c7 (diff)
Big Dataloader Commit (openvic-simulation)
Diffstat (limited to 'scripts/build/glob_recursive.py')
-rw-r--r--scripts/build/glob_recursive.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/build/glob_recursive.py b/scripts/build/glob_recursive.py
new file mode 100644
index 0000000..db6eb80
--- /dev/null
+++ b/scripts/build/glob_recursive.py
@@ -0,0 +1,15 @@
+def GlobRecursive(pattern, nodes=['.']):
+ import SCons
+ import glob
+ fs = SCons.Node.FS.get_default_fs()
+ Glob = fs.Glob
+
+ results = []
+ for node in nodes:
+ nnodes = []
+ for f in Glob(str(node) + '/*', source=True):
+ if type(f) is SCons.Node.FS.Dir:
+ nnodes.append(f)
+ results += GlobRecursive(pattern, nnodes)
+ results += Glob(str(node) + '/' + pattern, source=True)
+ return results