worker-automate-hub 0.5.743__py3-none-any.whl → 0.5.744__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.
@@ -4,7 +4,10 @@ from datetime import datetime
4
4
  from pywinauto import Application, timings, findwindows
5
5
  import sys
6
6
  import io
7
- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')))
7
+
8
+ sys.path.append(
9
+ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
10
+ )
8
11
 
9
12
  from worker_automate_hub.models.dto.rpa_historico_request_dto import (
10
13
  RpaHistoricoStatusEnum,
@@ -45,9 +48,9 @@ pyautogui.FAILSAFE = False
45
48
  async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
46
49
  try:
47
50
  config = await get_config_by_name("login_emsys")
48
- periodo = task.configEntrada['periodo']
49
- periodo_format = periodo.replace("/","")
50
- filial = task.configEntrada['filialEmpresaOrigem']
51
+ periodo = task.configEntrada["periodo"]
52
+ periodo_format = periodo.replace("/", "")
53
+ filial = task.configEntrada["filialEmpresaOrigem"]
51
54
  historico_id = task.historico_id
52
55
  await kill_all_emsys()
53
56
 
@@ -80,7 +83,7 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
80
83
  ##### Janela Relatório Saldos do Estoque #####
81
84
  # Marcar check box data
82
85
  app = Application().connect(class_name="TFrmRelSaldoEstoque", timeout=60)
83
- main_window = app["TFrmRelSaldoEstoque"]
86
+ main_window = app["TFrmRelSaldoEstoque"]
84
87
  main_window.set_focus()
85
88
 
86
89
  # Captura o campo de data
@@ -90,39 +93,39 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
90
93
 
91
94
  await worker_sleep(2)
92
95
  # Insere a data
93
- data_input = main_window.child_window(
94
- class_name="TDBIEditDate", found_index=0
95
- )
96
-
96
+ data_input = main_window.child_window(class_name="TDBIEditDate", found_index=0)
97
+
97
98
  data_input.set_edit_text(periodo)
98
99
 
99
100
  # Clicar em gerar relatório
100
101
  btn_gerar = main_window.child_window(
101
102
  class_name="TBitBtn", found_index=0
102
- ).click_input()
103
+ ).click_input()
103
104
 
104
105
  # Aguarda até 60 segundos para a janela aparecer
105
106
  timings.wait_until_passes(
106
107
  timeout=1800,
107
108
  retry_interval=1,
108
- func=lambda: Application().connect(class_name="TFrmPreviewRelatorio")
109
+ func=lambda: Application().connect(class_name="TFrmPreviewRelatorio"),
109
110
  )
110
111
 
111
112
  await worker_sleep(2)
112
113
 
113
- # Conecta à janela Preview Relatorio
114
+ # Conecta à janela Preview Relatorio
114
115
  app = Application().connect(class_name="TFrmPreviewRelatorio")
115
116
  main_window = app["TFrmPreviewRelatorio"]
116
117
  main_window.set_focus()
117
118
 
118
119
  # Clicar em salvar
119
- caminho = r"assets\\extracao_realtorios\\btn_salvar.png"
120
+ caminho = r"assets\\extracao_relatorios\\btn_salvar.png"
120
121
  # Verifica se o arquivo existe
121
122
  if os.path.isfile(caminho):
122
123
  print("A imagem existe:", caminho)
123
124
 
124
125
  # Procura a imagem na tela
125
- pos = pyautogui.locateCenterOnScreen(caminho, confidence=0.9) # ajuste o confidence se necessário
126
+ pos = pyautogui.locateCenterOnScreen(
127
+ caminho, confidence=0.9
128
+ ) # ajuste o confidence se necessário
126
129
  if pos:
127
130
  pyautogui.click(pos) # clica no centro da imagem
128
131
  print("Clique realizado na imagem.")
@@ -151,8 +154,8 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
151
154
 
152
155
  # Clicar em Salvar
153
156
  btn_salvar = main_window.child_window(
154
- class_name="TBitBtn", found_index=1
155
- ).click_input()
157
+ class_name="TBitBtn", found_index=1
158
+ ).click_input()
156
159
 
157
160
  await worker_sleep(5)
158
161
 
@@ -161,7 +164,9 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
161
164
  main_window = app.window(title_re="Salvar para arquivo")
162
165
 
163
166
  # Campo Nome (Edit) - use set_edit_text para evitar problemas de escape
164
- campo_nome = main_window.child_window(class_name="Edit", control_id=1148).wrapper_object()
167
+ campo_nome = main_window.child_window(
168
+ class_name="Edit", control_id=1148
169
+ ).wrapper_object()
165
170
  caminho_arquivo = rf"C:\Users\automatehub\Downloads\saldo_estoque_{periodo_format}_{filial}.xlsx"
166
171
  campo_nome.set_focus()
167
172
  campo_nome.set_edit_text(caminho_arquivo)
@@ -169,15 +174,15 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
169
174
  print("✅ Texto inserido no campo Nome")
170
175
 
171
176
  await worker_sleep(2)
172
-
177
+
173
178
  # Clicar em ok para salvar
174
179
  btn_ok = main_window.child_window(
175
180
  class_name="Button", found_index=0
176
- ).click_input()
181
+ ).click_input()
177
182
 
178
183
  await worker_sleep(5)
179
184
 
180
- caminho_img = r"assets\\extracao_realtorios\\janela_printing.png"
185
+ caminho_img = r"assets\\extracao_relatorios\\janela_printing.png"
181
186
 
182
187
  # Aguarda até a janela com título "Printing" (ou "Salvando...") fechar
183
188
  try:
@@ -191,7 +196,7 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
191
196
  except findwindows.ElementNotFoundError:
192
197
  print("⚠️ Janela 'Printing' não estava aberta.")
193
198
 
194
- nome_com_extensao = f'saldo_estoque_{periodo_format}_{filial}.xlsx'
199
+ nome_com_extensao = f"saldo_estoque_{periodo_format}_{filial}.xlsx"
195
200
  # lê o arquivo
196
201
  with open(f"{caminho_arquivo}", "rb") as file:
197
202
  file_bytes = io.BytesIO(file.read())
@@ -229,4 +234,3 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
229
234
  status=RpaHistoricoStatusEnum.Falha,
230
235
  tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
231
236
  )
232
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.743
3
+ Version: 0.5.744
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
@@ -70,7 +70,7 @@ worker_automate_hub/tasks/jobs/entrada_de_notas_9000.py,sha256=0mOmS28tQKF5m7vMz
70
70
  worker_automate_hub/tasks/jobs/exemplo_processo.py,sha256=nV0iLoip2FH2-FhLmhX3nPqsfl_MPufZ3E5Q5krJvdc,3544
71
71
  worker_automate_hub/tasks/jobs/extracao_fechamento_contabil.py,sha256=6Kr5DKjKLqtFvGzyiXtt7xrQsuU898l8pQXDq9C6AX8,19567
72
72
  worker_automate_hub/tasks/jobs/extracao_fechamento_emsys.py,sha256=-T2nZUDiFrUGm_KLxJd_4qcrageDxVpWW3KAAniLFC4,21448
73
- worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py,sha256=EIPmA73cOaiw3hGQ6ZG4BGfGzV_InufAMZUZuXBuIq8,8219
73
+ worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py,sha256=xkwAoEJVBmEa5DCkUJouqR_Mj1X6HSzm3tHju3Lcp04,8241
74
74
  worker_automate_hub/tasks/jobs/fechar_conexao_rdp.py,sha256=UWAKCS2dbfgDlSQOBdjmVJXfD1MMuUrOi3weDgB0CAc,5718
75
75
  worker_automate_hub/tasks/jobs/fidc_exportacao_docs_portal_b2b.py,sha256=tWUmYy3Zhi3JEt8AoqTsWpU-wbf5-OxhCrTOooh1WH4,15616
76
76
  worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py,sha256=FAmcCqKVjedf7wIped8XRLIZ9S3oWc6fakF-r1Zm0kg,12637
@@ -100,7 +100,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
100
100
  worker_automate_hub/utils/util.py,sha256=nV09AF8lu5poiMzWMAAgVS_VWvEuIRfNDmx46V7Nvzk,207279
101
101
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=TOXKSHOPxy8N3-ROpTGjNIHstX0i2b8qekcj1tRvjG8,38174
102
102
  worker_automate_hub/worker.py,sha256=uhZ3f-iaQ1i8cANbljp50vkYl-Xm0_sHtjwwF_2y72o,7191
103
- worker_automate_hub-0.5.743.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
104
- worker_automate_hub-0.5.743.dist-info/METADATA,sha256=YyURTHvjrhqWu0Dz5M-vnYuvB1g_xd0wZXtivVAGTGg,3049
105
- worker_automate_hub-0.5.743.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
106
- worker_automate_hub-0.5.743.dist-info/RECORD,,
103
+ worker_automate_hub-0.5.744.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
104
+ worker_automate_hub-0.5.744.dist-info/METADATA,sha256=ak32PIs2Zky0uLTFBvUS6jPzq7IkbjAaeLi2y3qCYyw,3049
105
+ worker_automate_hub-0.5.744.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
106
+ worker_automate_hub-0.5.744.dist-info/RECORD,,