]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/genfilelist.py
2 Walk a directory tree and output a filename list suitable for use
5 Usage: genfilelist.py [-r] build_root filespec(s)
10 import sys
, os
, glob
, stat
13 def walktree(names
, buildroot
, recurse
):
15 isdir
= os
.path
.isdir(name
)
16 printfilename(name
, buildroot
, isdir
)
18 walktree([os
.path
.join(name
, x
) for x
in os
.listdir(name
)], buildroot
, recurse
)
21 def printfilename(name
, buildroot
, isdir
):
23 realname
= name
[len(buildroot
):]
25 fmt
= "%%dir %%attr(%o, root, root) %s"
27 fmt
= "%%attr(%o, root, root) %s"
28 print fmt
% (s
[stat
.ST_MODE
] & 0777, realname
)
46 walktree(glob
.glob(os
.path
.join(buildroot
, arg
)), buildroot
, recurse
)
48 if __name__
== "__main__":