(consumer_key, consumer_secret, access_token, access_token_secret, login_confirm_text, twitter_state)
Logs into twitter using tweepy, gives user an error on failure
    :param consumer_key: input received from the UI
    :param consumer_secret: input received from the UI
    :param access_token: input received from the UI
    :param access_token_secret: input received from the UI
    :param login_confirm_text: confirmation text - shown to the user in the UI
    :param twitter_state: dictionary holding twitter settings
    :return: none
Logs into twitter using tweepy, gives user an error on failure
    :param consumer_key: input received from the UI
    :param consumer_secret: input received from the UI
    :param access_token: input received from the UI
    :param access_token_secret: input received from the UI
    :param login_confirm_text: confirmation text - shown to the user in the UI
    :param twitter_state: dictionary holding twitter settings
    :return: none
Logs into twitter using tweepy gives user an error on failure : param consumer_key : input received from the UI : param consumer_secret : input received from the UI : param access_token : input received from the UI : param access_token_secret : input received from the UI : param login_confirm_text : confirmation text - shown to the user in the UI : param twitter_state : dictionary holding twitter settings : return : none
def set_twitter_login(consumer_key, consumer_secret, access_token, access_token_secret, login_confirm_text, twitter_state):
    """
    Logs into twitter using tweepy, gives user an error on failure
    :param consumer_key: input received from the UI
    :param consumer_secret: input received from the UI
    :param access_token: input received from the UI
    :param access_token_secret: input received from the UI
    :param login_confirm_text: confirmation text - shown to the user in the UI
    :param twitter_state: dictionary holding twitter settings
    :return: none
    """
    global twitter_api

    auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
    auth.set_access_token(access_token, access_token_secret)

    api = tweepy.API(auth)

    twitter_username = api.me().screen_name
    login_confirm_text.set(f'Logged in to Twitter as {twitter_username}')

    twitter_api = api
    twitter_state['login_info'] = {
        'consumer_key': consumer_key,
        'consumer_secret': consumer_secret,
        'access_token': access_token,
        'access_token_secret': access_token_secret
    }

    check_for_existence('time_to_save', twitter_state,
                        arrow.utcnow().replace(hours=0))
    check_for_existence('max_favorites', twitter_state, 0)
    check_for_existence('max_retweets', twitter_state, 0)
    check_for_existence('whitelisted_tweets', twitter_state, {})
    check_for_existence('whitelisted_favorites', twitter_state, {})
    check_for_existence('scheduled_time', twitter_state, 0)

    twitter_state['scheduler_bool'] = 0
    twitter_state['whitelist_window_open'] = 0
    twitter_state['confirmation_window_open'] = 0
    twitter_state.sync
def set_twitter_login ( consumer_key , consumer_secret , access_token , access_token_secret , login_confirm_text , twitter_state ) : global twitter_api auth = tweepy . OAuthHandler ( consumer_key , consumer_secret ) auth . set_access_token ( access_token , access_token_secret ) api = tweepy . API ( auth ) twitter_username = api . me ( ) . screen_name login_confirm_text . set ( f'Logged in to Twitter as {twitter_username}' ) twitter_api = api twitter_state [ 'login_info' ] = { 'consumer_key' : consumer_key , 'consumer_secret' : consumer_secret , 'access_token' : access_token , 'access_token_secret' : access_token_secret } check_for_existence ( 'time_to_save' , twitter_state , arrow . utcnow ( ) . replace ( hours = 0 ) ) check_for_existence ( 'max_favorites' , twitter_state , 0 ) check_for_existence ( 'max_retweets' , twitter_state , 0 ) check_for_existence ( 'whitelisted_tweets' , twitter_state , { } ) check_for_existence ( 'whitelisted_favorites' , twitter_state , { } ) check_for_existence ( 'scheduled_time' , twitter_state , 0 ) twitter_state [ 'scheduler_bool' ] = 0 twitter_state [ 'whitelist_window_open' ] = 0 twitter_state [ 'confirmation_window_open' ] = 0 twitter_state . sync