Beispiel #1
0
def log_in():
    driver_config_head = driver_config
    driver_config['driver_headless'] = False
    client_login = WhatsApp(driver_config=driver_config_head)
    client_login.open_whats_app_web()
    sleep(5)
    if client_login.is_logged_in():
        print('Login Successful')
        client_login.close_whats_app()
        return True
    else:
        print('Login unsuccessful')
        client_login.close_whats_app()
        return False
def interact_with_whats_app():
    client_headless = WhatsApp(driver_config)
    client_headless.open_whats_app_web()
    print(
        client_headless.send_message('Veera Mani', 'Testing ignore',
                                     Constants.TEXT))
    client_headless.close_whats_app()
Beispiel #3
0
    sleep(5)
    if client_login.is_logged_in():
        print('Login Successful')
        client_login.close_whats_app()
        return True
    else:
        print('Login unsuccessful')
        client_login.close_whats_app()
        return False


def interact_with_whats_app():
    client_headless = WhatsApp(driver_config)
    client_headless.open_whats_app_web()
    print(client_headless.send_message('ME', 'Testing', Constants.TEXT))
    client_headless.close_whats_app()


if __name__ == '__main__':
    client = WhatsApp(driver_config)
    is_logged_in = client.is_logged_in()
    client.close_whats_app()
    if is_logged_in:
        interact_with_whats_app()
    else:
        if log_in():
            interact_with_whats_app()
        else:
            print('Please try again later')

Beispiel #4
0
        task = input("Enter the task details: ")
        scheduler.store_task_info(task_info=loads(task))
        logger.info(f'Task stored {task}')


def bind_shared_objects(manager):
    provider_instance = manager.Provider()
    scheduler_instance = manager.Scheduler(provider_instance)
    return [provider_instance, scheduler_instance]


def start():
    CustomManager.register('Scheduler', Scheduler)
    CustomManager.register('Provider', Provider)
    with CustomManager() as manager:
        # noinspection PyTypeChecker
        provider_instance, scheduler_instance = bind_shared_objects(manager)
        scheduler_process = Process(target=start_scheduler,
                                    args=[scheduler_instance])
        scheduler_process.start()
        request_for_task(scheduler_instance)
        scheduler_process.join()


if __name__ == "__main__":
    logger.info("Auto whats app started!!!")
    client = WhatsApp(driver_config)
    client.open_whats_app_web()
    idle(1, 'main opened whats app')
    start()
Beispiel #5
0
def launch_whats_app():
    global client
    logger.info("Auto whats app started!!!")
    client = WhatsApp(driver_config)
    client.open_whats_app_web()
    idle(1, 'main opened whats app')