bcpkgfox 0.17.6__tar.gz → 0.17.8__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.

Potentially problematic release.


This version of bcpkgfox might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcpkgfox
3
- Version: 0.17.6
3
+ Version: 0.17.8
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,18 @@ 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
+ self.select_system()
448
+ return
449
+ except:
450
+ pass
451
+
426
452
  # Selects the system to access
427
453
  lines = tools.find_elements_with_wait(By.XPATH, '//div[@role="menu"]//div[@role="menuitem"]')
428
454
 
@@ -470,6 +496,16 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
470
496
  mostrar_mensagem('Mais de um sistema encontrado, verifique o nome do sistema no WHOOM e coloque um nome único na função')
471
497
  raise ValueError('Mais de um sistema encontrado, verifique o nome')
472
498
 
499
+ try:
500
+ tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]',
501
+ timeout=1).click()
502
+ time.sleep(1)
503
+ self.codes_2_fac()
504
+ self.select_system()
505
+ return
506
+ except:
507
+ pass
508
+
473
509
  # Verifies if the system was opened
474
510
  for _ in range(30):
475
511
  time.sleep(1)
@@ -508,4 +544,5 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
508
544
  # Operacional
509
545
  bot.extension_check()
510
546
  protection.start()
511
- bot.codes_2_fac()
547
+ bot.codes_2_fac()
548
+ 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.8
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.8",
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