Exemplo n.º 1
0
def run_push_for_all_users():
	user_list = token_store.get_email_prio_users()
	# user_list = ['*****@*****.**', '*****@*****.**', '*****@*****.**']
	# print user_list
	# user_list = ['*****@*****.**']
	white_list = token_store.get_white_list()
	for email_id in user_list:
		try:
			run_push_for_user(email_id,white_list)
		except Exception as e:
			print "push sender crashed for " + email_id + "exp {" + traceback.format_exc() + "}"
	return
Exemplo n.º 2
0
def run_push_for_all_users():
    user_list = token_store.get_email_prio_users()
    # user_list = ['*****@*****.**', '*****@*****.**', '*****@*****.**']
    # print user_list
    # user_list = ['*****@*****.**']
    white_list = token_store.get_white_list()
    for email_id in user_list:
        try:
            run_push_for_user(email_id, white_list)
        except Exception as e:
            print "push sender crashed for " + email_id + "exp {" + traceback.format_exc(
            ) + "}"
    return
Exemplo n.º 3
0
def tag_new_mails_for_all_users():

	user_list = token_store.get_email_prio_users()
	# user_list = ['*****@*****.**']
	white_list = token_store.get_white_list()
	# print white_list
	# print user_list
	for email_id in user_list:
		try:
			tag_new_mails(email_id,white_list)
		except Exception as e:
			try:
				if type(e) == nylas.client.errors.NotFoundError:
					if e.as_dict()['message'] == 'Account deleted':
						token_store.remove_user_from_prio(email_id)
						print "Removed "+email_id+". Showed 'Account deleted' error."
				else:
					print 'tagger crashed for ' + email_id + ' Exception : {' + traceback.format_exc() + '}'
			except Exception as e2:
				print 'tagger deleter crashed for ' + email_id + ' Exception : {' + traceback.format_exc() + '}'
	return
Exemplo n.º 4
0
def tag_new_mails_for_all_users():

    user_list = token_store.get_email_prio_users()
    # user_list = ['*****@*****.**']
    white_list = token_store.get_white_list()
    # print white_list
    # print user_list
    for email_id in user_list:
        try:
            tag_new_mails(email_id, white_list)
        except Exception as e:
            try:
                if type(e) == nylas.client.errors.NotFoundError:
                    if e.as_dict()['message'] == 'Account deleted':
                        token_store.remove_user_from_prio(email_id)
                        print "Removed " + email_id + ". Showed 'Account deleted' error."
                else:
                    print 'tagger crashed for ' + email_id + ' Exception : {' + traceback.format_exc(
                    ) + '}'
            except Exception as e2:
                print 'tagger deleter crashed for ' + email_id + ' Exception : {' + traceback.format_exc(
                ) + '}'
    return