worker-automate-hub 0.4.403__py3-none-any.whl → 0.4.404__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -613,10 +613,10 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
613
613
  app = Application().connect(title="Informação")
614
614
  dialog = app.window(title="Informação")
615
615
 
616
- btn_ok = dialog.child_window(title="OK", class_name="Button")
617
- if btn_ok.exists():
616
+ btn_yes = dialog.child_window(title="OK", class_name="Button")
617
+ if btn_yes.exists():
618
618
  try:
619
- btn_ok.click()
619
+ btn_yes.click()
620
620
  await worker_sleep(3)
621
621
  console.print(
622
622
  "O botão OK de pré-venda incluída foi clicado com sucesso.",
@@ -632,7 +632,6 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
632
632
  retorno=f"Falha ao clicar no botão OK de pré-venda incluída: {e}",
633
633
  status=RpaHistoricoStatusEnum.Falha,
634
634
  )
635
-
636
635
  else:
637
636
 
638
637
  console.print(
@@ -656,22 +655,66 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
656
655
 
657
656
  await worker_sleep(3)
658
657
 
659
- screenshot_path = take_screenshot()
658
+ # screenshot_path = take_screenshot()
660
659
  # Message 'Deseja pesquisar pré-venda?'
661
660
  console.print(
662
661
  "Verificando a existencia da mensagem: 'Deseja pesquisar pré-venda?'...\n"
663
662
  )
664
- message_prevenda = take_target_position(screenshot_path, "Deseja")
665
- if message_prevenda is not None:
666
- button_yes = find_target_position(screenshot_path, "Yes", attempts=5)
667
- if button_yes is not None:
668
- pyautogui.click(button_yes)
663
+ try:
664
+ app = Application().connect(title="Confirm")
665
+ dialog_prevenda = app.window(title="Confirm")
666
+
667
+ btn_yes = dialog_prevenda.child_window(title="&Yes", class_name="TButton")
668
+ if btn_yes.exists():
669
+ try:
670
+ btn_yes.click()
671
+ await worker_sleep(3)
672
+ console.print(
673
+ "O botão YES de pesquisa pré-venda incluída foi clicado com sucesso.",
674
+ style="green",
675
+ )
676
+ except Exception as e:
677
+ console.print(
678
+ f"Falha ao clicar no botão YES de pesquisa pré-venda incluída: {e}",
679
+ style="red",
680
+ )
681
+ return RpaRetornoProcessoDTO(
682
+ sucesso=False,
683
+ retorno=f"Falha ao clicar no botão YES de pesquisa pré-venda incluída: {e}",
684
+ status=RpaHistoricoStatusEnum.Falha,
685
+ )
669
686
  else:
670
- pyautogui.click(914,560)
671
- console.log('Clicou em "Yes" para confirmar pré-venda', style="bold green")
672
- else:
673
- log_msg = f"Mensagem 'Deseja pesquisar pré-venda?' não encontrada."
674
- console.print(log_msg, style="bold yellow")
687
+
688
+ console.print(
689
+ "O Botão OK de pré-venda incluída não foi encontrado.", style="red"
690
+ )
691
+ return RpaRetornoProcessoDTO(
692
+ sucesso=False,
693
+ retorno="O Botão YES de pesquisa pré-venda incluída não foi encontrado.",
694
+ status=RpaHistoricoStatusEnum.Falha,
695
+ )
696
+
697
+ except Exception as e:
698
+ console.print(
699
+ f"O Botão YES de pesquisa pré-venda incluída não foi encontrado: {e}", style="red"
700
+ )
701
+ return RpaRetornoProcessoDTO(
702
+ sucesso=False,
703
+ retorno=f"O Botão YES de pesquisa pré-venda incluída não foi encontrado: {e}",
704
+ status=RpaHistoricoStatusEnum.Falha,
705
+ )
706
+
707
+ # message_prevenda = take_target_position(screenshot_path, "Deseja")
708
+ # if message_prevenda is not None:
709
+ # button_yes = find_target_position(screenshot_path, "Yes", attempts=5)
710
+ # if button_yes is not None:
711
+ # pyautogui.click(button_yes)
712
+ # else:
713
+ # pyautogui.click(914,560)
714
+ # console.log('Clicou em "Yes" para confirmar pré-venda', style="bold green")
715
+ # else:
716
+ # log_msg = f"Mensagem 'Deseja pesquisar pré-venda?' não encontrada."
717
+ # console.print(log_msg, style="bold yellow")
675
718
  await worker_sleep(5)
676
719
 
677
720
  # screenshot_path = take_screenshot()
@@ -767,7 +810,7 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
767
810
  pyautogui.click(pre_venda_sucesso)
768
811
  console.log('Clicou em "OK" na mensagem de sucesso', style="bold green")
769
812
 
770
- await worker_sleep(5)
813
+ await worker_sleep(10)
771
814
 
772
815
  # Faturando Pre-venda
773
816
  retorno = await faturar_pre_venda(task)
@@ -856,5 +899,4 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
856
899
  sucesso=False,
857
900
  retorno=log_msg,
858
901
  status=RpaHistoricoStatusEnum.Falha,
859
- )
860
-
902
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: worker-automate-hub
3
- Version: 0.4.403
3
+ Version: 0.4.404
4
4
  Summary: Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta.
5
5
  Author: Joel Paim
6
6
  Requires-Python: >=3.12,<4.0
@@ -55,7 +55,7 @@ worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py,sha256=QBGm6eS5J
55
55
  worker_automate_hub/tasks/jobs/login_emsys.py,sha256=IoGCIvO4UwmuxOZEn3cvYJlKyhsWvtHvbFk8vwjTroQ,5620
56
56
  worker_automate_hub/tasks/jobs/playground.py,sha256=bdnXv3C7WLQUxt4edGZDfAbRJJ2-q4zuIQaK3GLnaUc,1765
57
57
  worker_automate_hub/tasks/jobs/sped_fiscal.py,sha256=KquAdk26kvIKqT5hkHvzKMpa1UzJphx6s7qDv9pVuH4,26243
58
- worker_automate_hub/tasks/jobs/transferencias.py,sha256=keCUlvbPhLrTiZQ9Co_r6IqL5wjYqVGB_-mgvdDe9pM,36080
58
+ worker_automate_hub/tasks/jobs/transferencias.py,sha256=GM8OjjIgxu9biXYyQVnW3c-af06tdIPqy3s9QH9UXSs,38023
59
59
  worker_automate_hub/tasks/task_definitions.py,sha256=2Jp1H4_qJZqqGyaP6MA87KLt4QNrtWBYWbXu-2gymFo,4459
60
60
  worker_automate_hub/tasks/task_executor.py,sha256=eXFgWbcM8aMPwENvNix8KyFv7BqvIwhXUDkBSI1ul7M,8873
61
61
  worker_automate_hub/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -67,7 +67,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
67
67
  worker_automate_hub/utils/util.py,sha256=YCbgMMBwhp9LD6NUmE5S2K6S12TNEpGJm25FqfsIKPE,119544
68
68
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=yQFyDzvXPSO-UYV1m38WLJ3AWQgZYcyUkHZdCKE1jG4,28360
69
69
  worker_automate_hub/worker.py,sha256=KDBU3L2kVobndrnN5coRZFTwVmBLKmPJjRv20sCo5Hc,4697
70
- worker_automate_hub-0.4.403.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
71
- worker_automate_hub-0.4.403.dist-info/METADATA,sha256=IN1TuqG_rz_vigeyb-kIbf32zEusW-lXw_U3D7lFKwk,2895
72
- worker_automate_hub-0.4.403.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
73
- worker_automate_hub-0.4.403.dist-info/RECORD,,
70
+ worker_automate_hub-0.4.404.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
71
+ worker_automate_hub-0.4.404.dist-info/METADATA,sha256=JCgJOuaKdUaHqNe89o2mchau7CnsD5_rIpEqtLIxgU4,2895
72
+ worker_automate_hub-0.4.404.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
73
+ worker_automate_hub-0.4.404.dist-info/RECORD,,