Esempio n. 1
0
def get_msg_score(email,token, use_psync):
	# current_time_stamp = get_current_time_stamp()
	upto_weeks = 4
	# past_time_stamp = get_old_time_stamp(7)
	# token = get_access_token(email)
	# get_sent_msg_count_in_range(current_time_stamp,past_time_stamp,email,token)
	sent_stat = [None] * upto_weeks
	receive_stat = [None] * upto_weeks
	unread_stat = [None] * upto_weeks
	# unseen_stat = [None] * upto_weeks
	# print "get_msg_score"
	for i in xrange(0,upto_weeks):
		# print 'i = ',i
		if i == 0:
			future_time_stamp = helper.get_current_time_stamp()
		else:
			future_time_stamp = helper.get_old_time_stamp(i*7)
		past_time_stamp = helper.get_old_time_stamp((i+1) * 7)
		sent_stat[i] = get_msg_count_in_range(future_time_stamp,past_time_stamp,email,token,'from', use_psync)
		# print 'sent_stat'
		receive_stat[i] = get_msg_count_in_range(future_time_stamp,past_time_stamp,email,token,'to', use_psync)
		# print 'receive_stat'
		unread_stat[i] = get_thread_participant_score_with_tags(future_time_stamp,past_time_stamp,token,'unread',email, use_psync)
		# print 'unread_stat'
		# unseen_stat[i] = get_thread_participant_score_with_tags(future_time_stamp,past_time_stamp,token,'unseen',email)
		# print 'unseen_stat'
	helper.save_json('sent_last.json',sent_stat)
	helper.save_json('receive_last.json',receive_stat)
	helper.save_json('unread_last.json',unread_stat)
	# helper.save_json('unseen_last.json',unseen_stat)

	return
Esempio n. 2
0
def run_followup_manager_for_user(email_id):
	current_time_stamp = helper.get_current_time_stamp()
	expired_thread_list = token_store.get_expired_threads_from_followup(email_id,current_time_stamp)
	# print expired_thread_list
	if len(expired_thread_list) > 0:
		print 'expired threads found'
		manage_expired_threads(email_id,expired_thread_list)
	else:
		print 'no expired thread found for ' + email_id
	return
Esempio n. 3
0
def get_msg_score(email, token, use_psync):
    # current_time_stamp = get_current_time_stamp()
    upto_weeks = 4
    # past_time_stamp = get_old_time_stamp(7)
    # token = get_access_token(email)
    # get_sent_msg_count_in_range(current_time_stamp,past_time_stamp,email,token)
    sent_stat = [None] * upto_weeks
    receive_stat = [None] * upto_weeks
    unread_stat = [None] * upto_weeks
    # unseen_stat = [None] * upto_weeks
    # print "get_msg_score"
    for i in xrange(0, upto_weeks):
        # print 'i = ',i
        if i == 0:
            future_time_stamp = helper.get_current_time_stamp()
        else:
            future_time_stamp = helper.get_old_time_stamp(i * 7)
        past_time_stamp = helper.get_old_time_stamp((i + 1) * 7)
        sent_stat[i] = get_msg_count_in_range(future_time_stamp,
                                              past_time_stamp, email, token,
                                              'from', use_psync)
        # print 'sent_stat'
        receive_stat[i] = get_msg_count_in_range(future_time_stamp,
                                                 past_time_stamp, email, token,
                                                 'to', use_psync)
        # print 'receive_stat'
        unread_stat[i] = get_thread_participant_score_with_tags(
            future_time_stamp, past_time_stamp, token, 'unread', email,
            use_psync)
        # print 'unread_stat'
        # unseen_stat[i] = get_thread_participant_score_with_tags(future_time_stamp,past_time_stamp,token,'unseen',email)
        # print 'unseen_stat'
    helper.save_json('sent_last.json', sent_stat)
    helper.save_json('receive_last.json', receive_stat)
    helper.save_json('unread_last.json', unread_stat)
    # helper.save_json('unseen_last.json',unseen_stat)

    return