[Scons-users] Glob

Andrew Featherstone andrew.featherstone at gmail.com
Sat Mar 8 14:54:15 EST 2014


On 03/08/2014 07:42 PM, Gary Oberbrunner wrote:

>

>

>

> On Sat, Mar 8, 2014 at 2:36 PM, Russel Winder <russel at winder.org.uk

> <mailto:russel at winder.org.uk>> wrote:

>

> On Sat, 2014-03-08 at 19:32 +0000, Russel Winder wrote:

> [...]

> > map(str, Glob('*.cc')).remove(str(File('theFile.cc'))

> >

> > appears to do the trick.

>

> Except that is still fails. I can see the string 'theFile.cc' in the

> result of the map and remove still refuses to recognize it. I am

> flumoxed :-(

>

> Well, at this point it's all just strings, right? Print type() of

> each thing to make sure.

> --

> Gary

>

I'd agree with Gary. My example was generated off-memory from the
use-case I have at work (object files in a variant directory, no
duplication or sym-links to source files, a globbed set of inputs minus
a couple of files). Here's a very sparse SConstruct file with example
output:

# SConstruct
file_names = map(str, Glob('*.cc'))
print file_names
file_names.remove(str(File('foo.cc')))
print file_names

Example output:

$ scons
scons: Reading SConscript files ...
['bar.cc', 'bax.cc', 'foo.cc']
['bar.cc', 'bax.cc']

Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140308/e4f6e924/attachment.htm


More information about the Scons-users mailing list