Ejemplo n.º 1
0
def get_members(driver):
    logger.info("Retrieving Coffee Buddies participants...")
    members = utils.get_channel_members(driver, config.TEAM_NAME,
                                        config.CHANNEL_NAME,
                                        config.IGNORED_USER_IDS)

    logger.info("Successfully retrieved Coffee Buddies participants: %d",
                len(members))
    return members
Ejemplo n.º 2
0
def create_driver():
    logger.info("Creating Mattermost Driver...")
    driver_options = {
        'url': config.URL,
        'login_id': config.USERNAME,
        'password': config.PASSWORD,
        'port': config.PORT,
        'token': config.TOKEN
    }
    return mattermostdriver.Driver(driver_options)
Ejemplo n.º 3
0
def pair(session, driver, members):
    logger.info("Pairing Coffee Buddies participants...")
    pairs = utils.get_pairs(session, members)
    logger.debug(pairs)
    logger.info("Successfully paired Coffee Buddies participants.")
    logger.info("Messaging paired Coffee Buddies participants...")
    utils.message_pairs(driver, pairs)
    logger.info("Successfully messaged paired Coffee Buddies participants.")
Ejemplo n.º 4
0
def prepare_db(session, members):
    logger.info("Preparing participants database...")
    utils.create_users(session, members)
    utils.create_pairs(session, members)
    logger.info("Successfully prepared participants database.")
Ejemplo n.º 5
0
def authenticate(driver):
    logger.info("Authenticating...")
    driver.login()
    driver.users.get_user('me')
    logger.info("Successfully authenticated.")