bcpkgfox 0.17.6__tar.gz → 0.17.7__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcpkgfox
3
- Version: 0.17.6
3
+ Version: 0.17.7
4
4
  Summary: Biblioteca BCFOX
5
5
  Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
6
6
  Author: BCFOX
@@ -1,3 +1,5 @@
1
+ import json
2
+
1
3
  from selenium.webdriver.support import expected_conditions as EC
2
4
  from selenium.webdriver.support.ui import WebDriverWait
3
5
  from selenium.webdriver.common.by import By
@@ -320,19 +322,32 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
320
322
 
321
323
  self.driver.get("https://chromewebstore.google.com/detail/whom-gerenciador-de-certi/lnidijeaekolpfeckelhkomndglcglhh")
322
324
 
323
- tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'no Chrome') or contains(text(), 'Usar') or contains(text(), 'Add to Chrome')]").click()
324
- time.sleep(5)
325
325
 
326
- # Envia TAB e ENTER do teclado físico
327
- pyautogui.press('tab')
328
- time.sleep(0.5)
329
- pyautogui.press('enter')
326
+ tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'no Chrome') or contains(text(), 'Usar') or contains(text(), 'Add to Chrome')]").click()
330
327
  time.sleep(5)
328
+ import pygetwindow as gw
329
+ windows = gw.getAllTitles()
330
+ for w in windows:
331
+ if w and "Whom?".lower() in w.lower():
332
+ print("Janela de extensão detectada:", w)
333
+ window = gw.getWindowsWithTitle(w)[0]
334
+ window.activate()
335
+ time.sleep(1)
336
+ coords = (gw.getActiveWindow().left + gw.getActiveWindow().size[0] // 2,
337
+ gw.getActiveWindow().top + int(gw.getActiveWindow().size[1] * 0.3))
338
+ pyautogui.moveTo(coords[0], coords[1])
339
+ pyautogui.click()
340
+
341
+ # Envia TAB e ENTER do teclado físico
342
+ pyautogui.press('tab')
343
+ time.sleep(0.5)
344
+ pyautogui.press('enter')
345
+ time.sleep(5)
346
+ break
331
347
 
332
348
  self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
333
349
 
334
350
  def codes_2_fac(self):
335
-
336
351
  try:
337
352
  tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=2).send_keys(self.system)
338
353
  code_insertion = True
@@ -422,7 +437,17 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
422
437
  if not(code_insertion):
423
438
  raise TimeoutError('Código WHOOM não chegou dentro do timeout estabelecido')
424
439
 
440
+ def select_system(self):
425
441
  time.sleep(4)
442
+ try:
443
+ tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]',
444
+ timeout=1).click()
445
+ time.sleep(1)
446
+ self.codes_2_fac()
447
+ return
448
+ except:
449
+ pass
450
+
426
451
  # Selects the system to access
427
452
  lines = tools.find_elements_with_wait(By.XPATH, '//div[@role="menu"]//div[@role="menuitem"]')
428
453
 
@@ -470,6 +495,7 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
470
495
  mostrar_mensagem('Mais de um sistema encontrado, verifique o nome do sistema no WHOOM e coloque um nome único na função')
471
496
  raise ValueError('Mais de um sistema encontrado, verifique o nome')
472
497
 
498
+
473
499
  # Verifies if the system was opened
474
500
  for _ in range(30):
475
501
  time.sleep(1)
@@ -508,4 +534,5 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
508
534
  # Operacional
509
535
  bot.extension_check()
510
536
  protection.start()
511
- bot.codes_2_fac()
537
+ bot.codes_2_fac()
538
+ bot.select_system()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcpkgfox
3
- Version: 0.17.6
3
+ Version: 0.17.7
4
4
  Summary: Biblioteca BCFOX
5
5
  Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
6
6
  Author: BCFOX
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="bcpkgfox",
5
- version="0.17.6",
5
+ version="0.17.7",
6
6
  author="BCFOX",
7
7
  author_email="bcfox@bcfox.com.br",
8
8
  description="Biblioteca BCFOX",
File without changes
File without changes
File without changes
File without changes
File without changes