bcpkgfox 0.17.1__py3-none-any.whl → 0.17.3__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.

Potentially problematic release.


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

bcpkgfox/invoke_api.py CHANGED
@@ -1,6 +1,10 @@
1
+ from selenium.webdriver.support import expected_conditions as EC
2
+ from selenium.webdriver.support.ui import WebDriverWait
3
+ from selenium.webdriver.common.by import By
1
4
  from typing import Optional
2
5
  from threading import Thread
3
6
  import time
7
+ import os
4
8
 
5
9
  def invoke_api_list(link: str, token: str, method: Optional[str] = "GET", headers: Optional[str] = None, print_response: Optional[bool] = False) -> dict:
6
10
  import requests
@@ -164,6 +168,9 @@ def invoke_api_proc_log(link, id_robo, token):
164
168
  print(f"\n{responseinsert.json()}")
165
169
 
166
170
  def login_2fac(driver, certificate, system, token, code_timeout=60):
171
+ import requests
172
+ import pyautogui
173
+ from . import mostrar_mensagem
167
174
 
168
175
  class login_2fac:
169
176
  def __init__(self):
@@ -462,30 +469,29 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
462
469
  raise ValueError('Mais de um sistema encontrado, verifique o nome')
463
470
 
464
471
  # Verifies if the system was opened
465
- num_windows = len(self.driver.window_handles)
466
- for _ in range(5):
472
+ for _ in range(30):
467
473
  time.sleep(1)
468
- if len(self.driver.window_handles) == num_windows:
474
+ if len(self.driver.window_handles) == 1:
469
475
  try:
470
476
  tools.find_element_with_wait(By.XPATH, "//button[text()='Acessar']", timeout=1).click()
471
477
  except:
472
- break
478
+ time.sleep(1)
473
479
  else:
480
+ time.sleep(3)
474
481
  break
475
482
 
476
- handles = self.driver.window_handles
477
- self.driver.switch_to.window(handles[-1])
478
- protection.stop()
479
-
483
+ self.driver.switch_to.window(self.driver.window_handles[-1])
480
484
  attempt = 0
481
485
  while 'whoom' in self.driver.title.strip().lower() and attempt <= 180:
482
486
  time.sleep(1)
483
487
  attempt += 1
488
+ time.sleep(5)
484
489
 
485
490
  if attempt >= 180:
486
491
  mostrar_mensagem('Whoom congelou no conectar com site.')
487
492
  raise SystemError('Whoom congelou no conectar com site.')
488
493
 
494
+ protection.stop()
489
495
  if len(self.driver.window_handles) > 1:
490
496
  self.driver.switch_to.window(self.driver.window_handles[0])
491
497
  self.driver.close()
@@ -500,4 +506,4 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
500
506
  # Operacional
501
507
  bot.extension_check()
502
508
  protection.start()
503
- bot.codes_2_fac()
509
+ bot.codes_2_fac()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcpkgfox
3
- Version: 0.17.1
3
+ Version: 0.17.3
4
4
  Summary: Biblioteca BCFOX
5
5
  Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
6
6
  Author: Guilherme Neri
@@ -6,10 +6,10 @@ bcpkgfox/examples.py,sha256=gNKQBlONca0W81QHwUlnv_-J135dEj9IwBhCpmohMYw,5486
6
6
  bcpkgfox/exec_file.py,sha256=fl_Do2SlF7JuXazpNTod-e_0WZUk355fbd7ustQvi40,3728
7
7
  bcpkgfox/find_elements.py,sha256=oeB-73LqMLoKchozPXuxRkThBju9IgUKqbgU-2AAq0s,23027
8
8
  bcpkgfox/get_driver.py,sha256=ohimk9E2hL6T35IXv0XX0uvWDGCUZvZDlPMnuRjV1R0,30490
9
- bcpkgfox/invoke_api.py,sha256=f4Sy1uEVEyI_--uM1Vllr6nJsZDZeS80emxe6UKLJm4,18713
9
+ bcpkgfox/invoke_api.py,sha256=OjJhqgrFRpvVBJf05AvkDOdwxVItZ_lily5Ja_V1Z18,18938
10
10
  bcpkgfox/system.py,sha256=3lyOWx893T6KiAI-jDv7zAo3oKPf0Q5CLgZ8TeFd0Do,7901
11
- bcpkgfox-0.17.1.dist-info/METADATA,sha256=oG5vcLxNDc6xYxD-ADi-ycplLwu89F_1gHVH0O-21tc,1911
12
- bcpkgfox-0.17.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
13
- bcpkgfox-0.17.1.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
14
- bcpkgfox-0.17.1.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
15
- bcpkgfox-0.17.1.dist-info/RECORD,,
11
+ bcpkgfox-0.17.3.dist-info/METADATA,sha256=Fm7TFjAKvHKmCrffAMGMc5XuhG07VoOopf8hqEV42nM,1911
12
+ bcpkgfox-0.17.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
13
+ bcpkgfox-0.17.3.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
14
+ bcpkgfox-0.17.3.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
15
+ bcpkgfox-0.17.3.dist-info/RECORD,,