worker-automate-hub 0.4.358__py3-none-any.whl → 0.4.359__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -256,7 +256,6 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
256
256
  status=RpaHistoricoStatusEnum.Falha,
257
257
  )
258
258
 
259
-
260
259
  await worker_sleep(5)
261
260
  warning_pop_up = await is_window_open("Aviso")
262
261
  if warning_pop_up["IsOpened"] == True:
@@ -266,23 +265,42 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
266
265
  status=RpaHistoricoStatusEnum.Falha,
267
266
  )
268
267
 
269
- await worker_sleep(45)
270
- max_attempts = 75
268
+ await worker_sleep(5)
269
+ max_attempts = 35
271
270
  i = 0
271
+
272
272
  while i < max_attempts:
273
- aviso_gerando_sped_full_path = "assets\\emsys\\gerando_sped_fiscal.png"
274
273
  try:
275
- aviso_gerando_sped_full_path = pyautogui.locateCenterOnScreen(aviso_gerando_sped_full_path, confidence=0.6)
276
- if aviso_gerando_sped_full_path:
277
- console.print(f"Gerando o arquivo Sped Fiscal...\n")
278
- i += 1
279
- console.print(f"Gerando o arquivo Sped Fiscal, Tentativa {i}/{max_attempts}: Aguarde mais 120 segundos...\n")
280
- await worker_sleep(120)
281
- else:
274
+ app = Application().connect(class_name="TMsgBox")
275
+ if "Informação" in app.windows():
276
+ main_window = app["Informação"]
277
+ console.print(f"Tela de Informação encontrada, saindo...\n")
278
+ break
279
+ elif "Aviso" in app.windows():
280
+ main_window = app["Aviso"]
281
+ console.print(f"Tela de Aviso encontrada, saindo...\n")
282
282
  break
283
- except:
284
- console.print(f"Tela de gerando sped não encontrada, verificando via elemento para dupla confirmação...\n")
285
- break
283
+ except Exception as e:
284
+ console.print(f"Erro ao verificar janelas: {e}. Continuando...\n")
285
+
286
+ warning_pop_up = await is_window_open("Aviso")
287
+ if warning_pop_up["IsOpened"]:
288
+ console.print(f"Tela de Aviso encontrada (via função is_window_open), saindo...\n")
289
+ break
290
+ else:
291
+ console.print(f"Tela de Aviso não encontrada, continuando...\n")
292
+
293
+ i += 1
294
+ await worker_sleep(120)
295
+
296
+ if i == max_attempts:
297
+ console.print("Número máximo de tentativas atingido. Encerrando...")
298
+ return RpaRetornoProcessoDTO(
299
+ sucesso=False,
300
+ retorno="Tempo esgotado e numero de tentativas atingido, não foi possivel obter o retorno de conclusão do SPED",
301
+ status=RpaHistoricoStatusEnum.Falha,
302
+ )
303
+
286
304
 
287
305
 
288
306
  # Verificando se possui pop-up de Aviso
@@ -356,7 +374,7 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
356
374
  # Verifica se a info 'Arquivo do SPED gerado com sucesso' está na tela
357
375
  await worker_sleep(6)
358
376
  try:
359
- max_attempts = 30
377
+ max_attempts = 10
360
378
  i = 0
361
379
 
362
380
  while i < max_attempts:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: worker-automate-hub
3
- Version: 0.4.358
3
+ Version: 0.4.359
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
@@ -54,7 +54,7 @@ worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py,sha256=Y-mKYcgX1kwcy_s
54
54
  worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py,sha256=QBGm6eS5JghgNWNqZlk1g2a2iV8LnBLiOTBBL3Giet0,4181
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
- worker_automate_hub/tasks/jobs/sped_fiscal.py,sha256=3gS7DJSsz_79xscj_z6I45-4_rHqicmDCvH99j8Dxek,21728
57
+ worker_automate_hub/tasks/jobs/sped_fiscal.py,sha256=zO76Q9_zZkchelVFvzXXmlKgqAxvPKrzLotemRE79PQ,22377
58
58
  worker_automate_hub/tasks/jobs/transferencias.py,sha256=keCUlvbPhLrTiZQ9Co_r6IqL5wjYqVGB_-mgvdDe9pM,36080
59
59
  worker_automate_hub/tasks/task_definitions.py,sha256=2Jp1H4_qJZqqGyaP6MA87KLt4QNrtWBYWbXu-2gymFo,4459
60
60
  worker_automate_hub/tasks/task_executor.py,sha256=QqVNRljSlSbSXzTwKLezMjCLej6AixuBcDAhDrqmAkU,8435
@@ -67,7 +67,7 @@ worker_automate_hub/utils/updater.py,sha256=0LR6Xpe3HZk-xu-trH7vKRhP5FXp0nhp1qxt
67
67
  worker_automate_hub/utils/util.py,sha256=hUzQOnVYwvlrFzAv1p5Lt3s1dmW_77NZFuG77QQHKL4,119565
68
68
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=4--3HDyWddT8vw2mBNY_-9IscvAQYBygwPIMiKvAG-w,27583
69
69
  worker_automate_hub/worker.py,sha256=vkl_x7gSo6nQlhSBLwRkGx6LEONnYptfBaGxOy1ZLsE,4634
70
- worker_automate_hub-0.4.358.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
71
- worker_automate_hub-0.4.358.dist-info/METADATA,sha256=9GiYDsw65nJ7Y8GRh-EqXYIXOH9faEcTFFFM58qFvoY,2895
72
- worker_automate_hub-0.4.358.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
73
- worker_automate_hub-0.4.358.dist-info/RECORD,,
70
+ worker_automate_hub-0.4.359.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
71
+ worker_automate_hub-0.4.359.dist-info/METADATA,sha256=WQrvkeWSU-pXc4SNmaoD6i8G3wpsyB-anSFlQiHf2es,2895
72
+ worker_automate_hub-0.4.359.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
73
+ worker_automate_hub-0.4.359.dist-info/RECORD,,