worker-automate-hub 0.4.428__tar.gz → 0.4.430__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/PKG-INFO +1 -1
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/pyproject.toml +1 -1
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/conexao_rdp.py +25 -20
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/README.md +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/ahead_service.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/client.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/helpers/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/rpa_historico_service.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/cli.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/config/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/config/settings.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/config.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/core/so_manipulation.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/deprecation.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/rate_limit.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/repeat.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/retry.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/singleton.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/timeit.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dao/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dto/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/playground.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/task_definitions.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/task_executor.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/__init__.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/env.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/logger.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/toast.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/updater.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/util.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
- {worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/worker.py +0 -0
@@ -26,16 +26,16 @@ class RDPConnection:
|
|
26
26
|
|
27
27
|
async def verificar_conexao(self) -> bool:
|
28
28
|
sistema_operacional = platform.system().lower()
|
29
|
-
|
29
|
+
console.print(f"Sistema operacional detectado: {sistema_operacional}")
|
30
30
|
if sistema_operacional == "windows":
|
31
31
|
comando_ping = ["ping", "-n", "1", "-w", "1000", self.ip]
|
32
32
|
else:
|
33
33
|
comando_ping = ["ping", "-c", "1", "-W", "1", self.ip]
|
34
|
-
|
34
|
+
console.print(f"Executando comando de ping: {' '.join(comando_ping)}")
|
35
35
|
try:
|
36
36
|
resposta_ping = subprocess.run(comando_ping, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
37
37
|
ping_alcancado = resposta_ping.returncode == 0
|
38
|
-
|
38
|
+
console.print(f"Ping {'sucesso' if ping_alcancado else 'falhou'}")
|
39
39
|
except Exception as e:
|
40
40
|
logger.error(f"Erro ao executar ping: {e}")
|
41
41
|
ping_alcancado = False
|
@@ -44,10 +44,10 @@ class RDPConnection:
|
|
44
44
|
try:
|
45
45
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
46
46
|
sock.settimeout(10)
|
47
|
-
|
47
|
+
console.print(f"Verificando porta 3389 em {self.ip}")
|
48
48
|
resposta_porta = sock.connect_ex((self.ip, 3389))
|
49
49
|
porta_aberta = resposta_porta == 0
|
50
|
-
|
50
|
+
console.print(f"Porta 3389 {'aberta' if porta_aberta else 'fechada'}")
|
51
51
|
except Exception as e:
|
52
52
|
logger.error(f"Erro ao verificar a porta RDP: {e}")
|
53
53
|
porta_aberta = False
|
@@ -64,15 +64,16 @@ class RDPConnection:
|
|
64
64
|
for win in gw.getAllTitles()
|
65
65
|
if "Conexão de Área de Trabalho Remota" in win
|
66
66
|
or "Remote Desktop Connection" in win
|
67
|
+
or "Ligação ao ambiente de trabalho remoto" in win
|
67
68
|
]
|
68
69
|
|
69
70
|
for titulo in janelas_rdp:
|
70
71
|
janela = gw.getWindowsWithTitle(titulo)[0]
|
71
72
|
if not janela:
|
72
|
-
print(f"Erro ao localizar a janela: {titulo}")
|
73
|
+
console.print(f"Erro ao localizar a janela: {titulo}")
|
73
74
|
continue
|
74
75
|
|
75
|
-
print(f"Processando janela: {titulo}")
|
76
|
+
console.print(f"Processando janela: {titulo}")
|
76
77
|
|
77
78
|
# Obtém as coordenadas da janela
|
78
79
|
x, y = janela.left, janela.top
|
@@ -90,20 +91,24 @@ class RDPConnection:
|
|
90
91
|
pyautogui.hotkey("enter")
|
91
92
|
|
92
93
|
except Exception as e:
|
93
|
-
print(f"Erro ao interagir com a janela {titulo}: {e}")
|
94
|
+
console.print(f"Erro ao interagir com a janela {titulo}: {e}")
|
94
95
|
|
95
96
|
async def conectar(self):
|
96
|
-
|
97
|
+
console.print(f"Iniciando cliente RDP para {self.ip}")
|
97
98
|
try:
|
98
99
|
pyautogui.hotkey("win", "d")
|
99
100
|
await worker_sleep(5) # Tempo para garantir que todas as janelas sejam minimizadas
|
100
|
-
|
101
|
+
console.print("Todas as janelas minimizadas com sucesso.")
|
101
102
|
|
102
103
|
subprocess.Popen(["mstsc", f"/v:{self.ip}"], close_fds=True, start_new_session=True)
|
103
104
|
await worker_sleep(10) # Tempo aumentado para garantir abertura
|
104
105
|
|
105
|
-
|
106
|
-
|
106
|
+
console.print("Procurando janela 'Conexão de Área de Trabalho Remota'")
|
107
|
+
try:
|
108
|
+
windows = gw.getWindowsWithTitle("Conexão de Área de Trabalho Remota")
|
109
|
+
except:
|
110
|
+
windows = gw.getWindowsWithTitle("Ligação ao ambiente de trabalho remoto")
|
111
|
+
|
107
112
|
if not windows:
|
108
113
|
logger.warning("Tentando encontrar janela com título em inglês 'Remote Desktop Connection'")
|
109
114
|
windows = gw.getWindowsWithTitle("Remote Desktop Connection")
|
@@ -113,7 +118,7 @@ class RDPConnection:
|
|
113
118
|
return False
|
114
119
|
|
115
120
|
rdp_window = windows[0]
|
116
|
-
|
121
|
+
console.print(f"Janela '{rdp_window.title}' encontrada. Focando na janela.")
|
117
122
|
|
118
123
|
# Restaurar janela se estiver minimizada
|
119
124
|
if rdp_window.isMinimized:
|
@@ -126,7 +131,7 @@ class RDPConnection:
|
|
126
131
|
new_height = screen_height // 2
|
127
132
|
rdp_window.resizeTo(new_width, new_height)
|
128
133
|
rdp_window.moveTo(screen_width // 4, screen_height // 4)
|
129
|
-
|
134
|
+
console.print(f"Janela redimensionada para {new_width}x{new_height}.")
|
130
135
|
|
131
136
|
rdp_window.activate()
|
132
137
|
await worker_sleep(5) # Tempo extra para garantir que a janela está ativa
|
@@ -144,24 +149,24 @@ class RDPConnection:
|
|
144
149
|
edit_field = dialog.child_window(auto_id="EditField_1", control_type="Edit")
|
145
150
|
|
146
151
|
if edit_field.exists():
|
147
|
-
|
152
|
+
console.print("Inserindo usuário.")
|
148
153
|
pyautogui.write(self.user, interval=0.1)
|
149
154
|
pyautogui.press("tab")
|
150
155
|
await worker_sleep(5)
|
151
156
|
except:
|
152
157
|
pass
|
153
158
|
|
154
|
-
|
159
|
+
console.print("Inserindo senha.")
|
155
160
|
pyautogui.write(self.password, interval=0.1)
|
156
161
|
pyautogui.press("enter")
|
157
162
|
await worker_sleep(5)
|
158
163
|
pyautogui.press("left")
|
159
164
|
await worker_sleep(5)
|
160
165
|
pyautogui.press("enter")
|
161
|
-
|
166
|
+
console.print("Credenciais inseridas.")
|
162
167
|
await worker_sleep(5) # Tempo para conexão ser concluída
|
163
168
|
|
164
|
-
|
169
|
+
console.print("Conexão RDP ativa. Mantendo o script em execução.")
|
165
170
|
return True
|
166
171
|
except Exception as e:
|
167
172
|
logger.error(f"Erro ao tentar conectar via RDP: {e}")
|
@@ -169,7 +174,7 @@ class RDPConnection:
|
|
169
174
|
|
170
175
|
async def conexao_rdp(task: RpaProcessoRdpDTO) -> RpaRetornoProcessoDTO:
|
171
176
|
try:
|
172
|
-
|
177
|
+
console.print("Iniciando processo de conexão RDP.")
|
173
178
|
rdp = RDPConnection(task)
|
174
179
|
conectado = await rdp.verificar_conexao()
|
175
180
|
if not conectado:
|
@@ -181,7 +186,7 @@ async def conexao_rdp(task: RpaProcessoRdpDTO) -> RpaRetornoProcessoDTO:
|
|
181
186
|
)
|
182
187
|
sucesso_conexao = await rdp.conectar()
|
183
188
|
if sucesso_conexao:
|
184
|
-
|
189
|
+
console.print("Processo de conexão RDP executado com sucesso.")
|
185
190
|
|
186
191
|
await rdp.clicar_no_titulo()
|
187
192
|
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/ahead_service.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/api/client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/config/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/config/settings.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/repeat.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/retry.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/decorators/timeit.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/models/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/tasks/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/env.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/logger.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/toast.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/updater.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.428 → worker_automate_hub-0.4.430}/worker_automate_hub/utils/util.py
RENAMED
File without changes
|
File without changes
|
File without changes
|