worker-automate-hub 0.4.428__py3-none-any.whl → 0.4.429__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/tasks/jobs/conexao_rdp.py +19 -19
- {worker_automate_hub-0.4.428.dist-info → worker_automate_hub-0.4.429.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.4.428.dist-info → worker_automate_hub-0.4.429.dist-info}/RECORD +5 -5
- {worker_automate_hub-0.4.428.dist-info → worker_automate_hub-0.4.429.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.4.428.dist-info → worker_automate_hub-0.4.429.dist-info}/entry_points.txt +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
|
@@ -69,10 +69,10 @@ class RDPConnection:
|
|
69
69
|
for titulo in janelas_rdp:
|
70
70
|
janela = gw.getWindowsWithTitle(titulo)[0]
|
71
71
|
if not janela:
|
72
|
-
print(f"Erro ao localizar a janela: {titulo}")
|
72
|
+
console.print(f"Erro ao localizar a janela: {titulo}")
|
73
73
|
continue
|
74
74
|
|
75
|
-
print(f"Processando janela: {titulo}")
|
75
|
+
console.print(f"Processando janela: {titulo}")
|
76
76
|
|
77
77
|
# Obtém as coordenadas da janela
|
78
78
|
x, y = janela.left, janela.top
|
@@ -90,19 +90,19 @@ class RDPConnection:
|
|
90
90
|
pyautogui.hotkey("enter")
|
91
91
|
|
92
92
|
except Exception as e:
|
93
|
-
print(f"Erro ao interagir com a janela {titulo}: {e}")
|
93
|
+
console.print(f"Erro ao interagir com a janela {titulo}: {e}")
|
94
94
|
|
95
95
|
async def conectar(self):
|
96
|
-
|
96
|
+
console.print(f"Iniciando cliente RDP para {self.ip}")
|
97
97
|
try:
|
98
98
|
pyautogui.hotkey("win", "d")
|
99
99
|
await worker_sleep(5) # Tempo para garantir que todas as janelas sejam minimizadas
|
100
|
-
|
100
|
+
console.print("Todas as janelas minimizadas com sucesso.")
|
101
101
|
|
102
102
|
subprocess.Popen(["mstsc", f"/v:{self.ip}"], close_fds=True, start_new_session=True)
|
103
103
|
await worker_sleep(10) # Tempo aumentado para garantir abertura
|
104
104
|
|
105
|
-
|
105
|
+
console.print("Procurando janela 'Conexão de Área de Trabalho Remota'")
|
106
106
|
windows = gw.getWindowsWithTitle("Conexão de Área de Trabalho Remota")
|
107
107
|
if not windows:
|
108
108
|
logger.warning("Tentando encontrar janela com título em inglês 'Remote Desktop Connection'")
|
@@ -113,7 +113,7 @@ class RDPConnection:
|
|
113
113
|
return False
|
114
114
|
|
115
115
|
rdp_window = windows[0]
|
116
|
-
|
116
|
+
console.print(f"Janela '{rdp_window.title}' encontrada. Focando na janela.")
|
117
117
|
|
118
118
|
# Restaurar janela se estiver minimizada
|
119
119
|
if rdp_window.isMinimized:
|
@@ -126,7 +126,7 @@ class RDPConnection:
|
|
126
126
|
new_height = screen_height // 2
|
127
127
|
rdp_window.resizeTo(new_width, new_height)
|
128
128
|
rdp_window.moveTo(screen_width // 4, screen_height // 4)
|
129
|
-
|
129
|
+
console.print(f"Janela redimensionada para {new_width}x{new_height}.")
|
130
130
|
|
131
131
|
rdp_window.activate()
|
132
132
|
await worker_sleep(5) # Tempo extra para garantir que a janela está ativa
|
@@ -144,24 +144,24 @@ class RDPConnection:
|
|
144
144
|
edit_field = dialog.child_window(auto_id="EditField_1", control_type="Edit")
|
145
145
|
|
146
146
|
if edit_field.exists():
|
147
|
-
|
147
|
+
console.print("Inserindo usuário.")
|
148
148
|
pyautogui.write(self.user, interval=0.1)
|
149
149
|
pyautogui.press("tab")
|
150
150
|
await worker_sleep(5)
|
151
151
|
except:
|
152
152
|
pass
|
153
153
|
|
154
|
-
|
154
|
+
console.print("Inserindo senha.")
|
155
155
|
pyautogui.write(self.password, interval=0.1)
|
156
156
|
pyautogui.press("enter")
|
157
157
|
await worker_sleep(5)
|
158
158
|
pyautogui.press("left")
|
159
159
|
await worker_sleep(5)
|
160
160
|
pyautogui.press("enter")
|
161
|
-
|
161
|
+
console.print("Credenciais inseridas.")
|
162
162
|
await worker_sleep(5) # Tempo para conexão ser concluída
|
163
163
|
|
164
|
-
|
164
|
+
console.print("Conexão RDP ativa. Mantendo o script em execução.")
|
165
165
|
return True
|
166
166
|
except Exception as e:
|
167
167
|
logger.error(f"Erro ao tentar conectar via RDP: {e}")
|
@@ -169,7 +169,7 @@ class RDPConnection:
|
|
169
169
|
|
170
170
|
async def conexao_rdp(task: RpaProcessoRdpDTO) -> RpaRetornoProcessoDTO:
|
171
171
|
try:
|
172
|
-
|
172
|
+
console.print("Iniciando processo de conexão RDP.")
|
173
173
|
rdp = RDPConnection(task)
|
174
174
|
conectado = await rdp.verificar_conexao()
|
175
175
|
if not conectado:
|
@@ -181,7 +181,7 @@ async def conexao_rdp(task: RpaProcessoRdpDTO) -> RpaRetornoProcessoDTO:
|
|
181
181
|
)
|
182
182
|
sucesso_conexao = await rdp.conectar()
|
183
183
|
if sucesso_conexao:
|
184
|
-
|
184
|
+
console.print("Processo de conexão RDP executado com sucesso.")
|
185
185
|
|
186
186
|
await rdp.clicar_no_titulo()
|
187
187
|
|
@@ -30,7 +30,7 @@ worker_automate_hub/models/dto/rpa_sistema_dto.py,sha256=sLkmJei8x6sl-1-IXUKDmYQ
|
|
30
30
|
worker_automate_hub/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
31
|
worker_automate_hub/tasks/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
32
|
worker_automate_hub/tasks/jobs/coleta_dje_process.py,sha256=rf4fW-FaHUl1MS7b03z4cwI3zHfNw8FWxvjvNY3Xn20,28773
|
33
|
-
worker_automate_hub/tasks/jobs/conexao_rdp.py,sha256=
|
33
|
+
worker_automate_hub/tasks/jobs/conexao_rdp.py,sha256=Bh0LbRULxW-SrESMtcX1SYnmZLbDI49l5ckYNnNlZCM,9045
|
34
34
|
worker_automate_hub/tasks/jobs/descartes.py,sha256=RIjrZIzkW77NiKeXbxFN9k872cz3fl9cG1m5TJpjmmY,40134
|
35
35
|
worker_automate_hub/tasks/jobs/ecac_estadual_go.py,sha256=aPckQRlRozFS_OK3C9wNdMCmqO6AM4djwqY2uSSaPmo,20687
|
36
36
|
worker_automate_hub/tasks/jobs/ecac_estadual_main.py,sha256=FFpAdtZLO4uelWZooCVpm4JePv_iDt5nwVKrk1ipZJQ,1599
|
@@ -68,7 +68,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
|
|
68
68
|
worker_automate_hub/utils/util.py,sha256=JpRM3ltfGNkzui0RAjUK1FhWT3aWUjt3ljEyQez3Sbw,120156
|
69
69
|
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=7ju688sD52y30taGSm5rPMGdQyByUUwveLeKV4ImEiE,28401
|
70
70
|
worker_automate_hub/worker.py,sha256=KDBU3L2kVobndrnN5coRZFTwVmBLKmPJjRv20sCo5Hc,4697
|
71
|
-
worker_automate_hub-0.4.
|
72
|
-
worker_automate_hub-0.4.
|
73
|
-
worker_automate_hub-0.4.
|
74
|
-
worker_automate_hub-0.4.
|
71
|
+
worker_automate_hub-0.4.429.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
72
|
+
worker_automate_hub-0.4.429.dist-info/METADATA,sha256=EHC72UJsPvLQvdYEYAi_cS3py8rpLYDWVE6IDTuifxQ,2895
|
73
|
+
worker_automate_hub-0.4.429.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
74
|
+
worker_automate_hub-0.4.429.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.4.428.dist-info → worker_automate_hub-0.4.429.dist-info}/entry_points.txt
RENAMED
File without changes
|