def testAvailableDescriptors(self): provider = MetadataSourceAggregator(sources, map) attributeIds = provider.AvailableDescriptors() expectedAttributeIds = [ "Song::Artist", "Song::Title", "Song::Genre", "Song::DynamicComplexity", "Frame::Energy", ] self.assertEquals(expectedAttributeIds, attributeIds)
if not os.access(options.ConfigurationFile, os.R_OK): print >> sys.stderr, "Bad Configuration File!" sys.exit(-1) execfile(options.ConfigurationFile) provider = MetadataSourceAggregator(config.sources, config.map, verbose=config.verbose) if options.printSchema is not None: target = sys.stdout if options.printSchema == "-" else open( options.printSchema, 'w') provider.QuerySchema(provider.AvailableDescriptors()).Dump(target) sys.exit() if not args: parser.print_help() sys.exit() #if options.writeback: sys.exit() for audiofile in args: print "Processing %s..." % audiofile target = open(audiofile + options.suffix, 'w') poolToCopy = provider.QueryDescriptors(audiofile, provider.AvailableDescriptors()) poolToCopy.Dump(target) if options.writeback: