def generate(): overreport = True for input in source: extension = splitext(input.name)[1] if extension == '.json': overreport = False yield '-iiglue-read-file' yield input elif extension == '.so': yield '-load' yield './%s' % input else: yield input if overreport: yield '-overreport'
def generate(): suffix = env.subst(builder.builder.suffix) for src in imap(File, source): obj = objdir.File(splitext(src.name)[0] + suffix) builder(obj, src) yield obj
def test_splitext(self): assert splitext('foo') == ('foo', '') assert splitext('foo.bar') == ('foo', '.bar') assert splitext(os.path.join('foo.bar', 'blat')) == (os.path.join( 'foo.bar', 'blat'), '')