worker-automate-hub 0.5.749__py3-none-any.whl → 0.5.751__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.
- worker_automate_hub/api/client.py +28 -24
- worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py +8 -7
- {worker_automate_hub-0.5.749.dist-info → worker_automate_hub-0.5.751.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.749.dist-info → worker_automate_hub-0.5.751.dist-info}/RECORD +6 -6
- {worker_automate_hub-0.5.749.dist-info → worker_automate_hub-0.5.751.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.749.dist-info → worker_automate_hub-0.5.751.dist-info}/entry_points.txt +0 -0
@@ -232,30 +232,34 @@ async def get_config_by_name(name: str) -> RpaConfiguracao:
|
|
232
232
|
if "API_BASE_URL" not in env_config:
|
233
233
|
raise ValueError("URL da API não encontrada na configuração do ambiente")
|
234
234
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
235
|
+
x = 0
|
236
|
+
while x < 10:
|
237
|
+
try:
|
238
|
+
headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
|
239
|
+
timeout = aiohttp.ClientTimeout(total=600)
|
240
|
+
|
241
|
+
async with aiohttp.ClientSession(
|
242
|
+
connector=aiohttp.TCPConnector(verify_ssl=True), timeout=timeout
|
243
|
+
) as session:
|
244
|
+
async with session.get(
|
245
|
+
f"{env_config["API_BASE_URL"]}/configuracao/api/{name}",
|
246
|
+
headers=headers_basic,
|
247
|
+
) as response:
|
248
|
+
if response.status != 200:
|
249
|
+
console.print(f"Erro ao obter a configuração: {response.content}")
|
250
|
+
x += 1
|
251
|
+
else:
|
252
|
+
data = await response.json()
|
253
|
+
return RpaConfiguracao(**data)
|
254
|
+
except Exception as e:
|
255
|
+
x += 1
|
256
|
+
err_msg = f"Erro ao obter a configuração: {e}"
|
257
|
+
logger.error(err_msg)
|
258
|
+
console.print(
|
259
|
+
f"{err_msg}\n",
|
260
|
+
style="bold red",
|
261
|
+
)
|
262
|
+
return None
|
259
263
|
|
260
264
|
|
261
265
|
def sync_get_config_by_name(name: str) -> RpaConfiguracao:
|
@@ -153,9 +153,7 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
153
153
|
await worker_sleep(2)
|
154
154
|
|
155
155
|
# Clicar em Salvar
|
156
|
-
main_window.child_window(
|
157
|
-
class_name="TBitBtn", found_index=1
|
158
|
-
).click_input()
|
156
|
+
main_window.child_window(class_name="TBitBtn", found_index=1).click_input()
|
159
157
|
|
160
158
|
await worker_sleep(5)
|
161
159
|
|
@@ -176,16 +174,14 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
176
174
|
await worker_sleep(2)
|
177
175
|
|
178
176
|
# Clicar em ok para salvar
|
179
|
-
main_window.child_window(
|
180
|
-
class_name="Button", found_index=0
|
181
|
-
).click_input()
|
177
|
+
main_window.child_window(class_name="Button", found_index=0).click_input()
|
182
178
|
|
183
179
|
await worker_sleep(20)
|
184
180
|
|
185
181
|
# caminho_img = r"assets\\extracao_relatorios\\janela_printing.png"
|
186
182
|
|
187
183
|
# Aguarda até a janela com título "Printing" (ou "Salvando...") fechar
|
188
|
-
|
184
|
+
|
189
185
|
try:
|
190
186
|
app = Application().connect(title_re="Printing") # conecta se existir
|
191
187
|
janela = app.window(title_re="Printing")
|
@@ -214,6 +210,11 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
214
210
|
)
|
215
211
|
console.print("Removendo arquivo XLS da pasta downloads")
|
216
212
|
os.remove(f"{caminho_arquivo}")
|
213
|
+
return RpaRetornoProcessoDTO(
|
214
|
+
sucesso=True,
|
215
|
+
retorno="Relatório gerado com sucesso",
|
216
|
+
status=RpaHistoricoStatusEnum.Sucesso,
|
217
|
+
)
|
217
218
|
|
218
219
|
except Exception as e:
|
219
220
|
console.print(f"Erro ao enviar o arquivo: {e}", style="bold red")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
worker_automate_hub/__init__.py,sha256=LV28uQvBfpPIqudGIMJmVB8E941MjXHcu8DMoX5n8AM,25
|
2
2
|
worker_automate_hub/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
worker_automate_hub/api/ahead_service.py,sha256=QbNrZf9q7fS0s-S5fZVytqC7dINi9u2f6aB6SDrGVVA,2231
|
4
|
-
worker_automate_hub/api/client.py,sha256=
|
4
|
+
worker_automate_hub/api/client.py,sha256=gKuIUhdAiMFE4YK3nR4SR2W8p1v4--7I64Pjs0oJsyM,31956
|
5
5
|
worker_automate_hub/api/datalake_service.py,sha256=qw_N_OOgDKDuPbI-fdYkWWTlT4CUtFTl0VVlZ0fLM-M,3001
|
6
6
|
worker_automate_hub/api/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
worker_automate_hub/api/helpers/api_helpers.py,sha256=SkheO2fXexeh-a4shr8Qzsz_kZhuSG0DJ7kbODctRbM,3696
|
@@ -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=
|
73
|
+
worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py,sha256=efGeQmQ5CGwWMyaNq-AV-xQ0NiXgz58bL5D7biON4BQ,8392
|
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=gFe4yrF2G6sToawOzlgRFWEJKlqtWYp4lXQFKgNQpZg,207420
|
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.
|
104
|
-
worker_automate_hub-0.5.
|
105
|
-
worker_automate_hub-0.5.
|
106
|
-
worker_automate_hub-0.5.
|
103
|
+
worker_automate_hub-0.5.751.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
104
|
+
worker_automate_hub-0.5.751.dist-info/METADATA,sha256=InFgMNvp97iVLoHcgK3iTAbLr_12mSDwPfIAVHEC0mI,3049
|
105
|
+
worker_automate_hub-0.5.751.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
106
|
+
worker_automate_hub-0.5.751.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.749.dist-info → worker_automate_hub-0.5.751.dist-info}/entry_points.txt
RENAMED
File without changes
|