def flush(from_test=False):
 cache = frappe.cache()
 check_email_limit([])
 auto_commit = (not from_test)
 if frappe.are_emails_muted():
  msgprint(_(u'Emails are muted'))
  from_test = True
 smtpserver = SMTPServer()
 make_cache_queue()
 for i in xrange(cache.llen(u'cache_email_queue')):
  email = cache.lpop(u'cache_email_queue')
  if (cint(frappe.defaults.get_defaults().get(u'hold_queue')) == 1):
   break
  if email:
   send_one(email, smtpserver, auto_commit, from_test=from_test)

def flush ( from_test = False ) : cache = frappe . cache ( ) check_email_limit ( [ ] ) auto_commit = ( not from_test ) if frappe . are_emails_muted ( ) : msgprint ( _ ( u'Emails are muted' ) ) from_test = True smtpserver = SMTPServer ( ) make_cache_queue ( ) for i in xrange ( cache . llen ( u'cache_email_queue' ) ) : email = cache . lpop ( u'cache_email_queue' ) if ( cint ( frappe . defaults . get_defaults ( ) . get ( u'hold_queue' ) ) == 1 ) : break if email : send_one ( email , smtpserver , auto_commit , from_test = from_test )
flush entries in the specified set .