def fillWithNoise(): fileServer = model.FileServer('', False) soundServer = model.SoundServer(False) database = model.Database(config.mongoConnect(), config.mongoDatabaseName()) with open("white_noise.ogg", "rb") as soundfile: for i in range(1000000): model.simpleSubmit( { 'attribute1': ''.join(random.sample(string.lowercase, random.randint(3, 7))), 'attribute2': ''.join(random.sample(string.lowercase, random.randint(3, 7))) }, soundfile, fileServer, soundServer, database)
def submit(): if request.files.sound and request.files.sound.file: model.simpleSubmit(request.forms.items(), request.files.sound.file, fileServer, soundServer, database) redirect('/view/0') else: return 'sound file is not attached'