Exemplo n.º 1
0
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()
Exemplo n.º 2
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
Exemplo n.º 3
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()
Exemplo n.º 4
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')