def call(self): vms = self.voicemails vms = vms.shuffled() num = 10 print("Playing %d tattles.." % num) call = Call() path = call.write(vms[0:num]) answered = call.execute(path) answered = True if answered: self.call_in(config.call_mins_after_answer) else: self.call_in(config.call_mins_after_no_answer)
from voicemails import Voicemails from call import Call vms = Voicemails() call = Call() vms.read() print(vms.voicemails) vms.filter() vms = vms.shuffled() num = min(len(vms), 1) for i in range(num): vms[i].prep_playback(i) print("Playing %d tattles.." % num) path = call.write(num) call.execute(path) print(path)