bcpkgfox 0.16.66__py3-none-any.whl → 0.16.67__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 +50 -37
- {bcpkgfox-0.16.66.dist-info → bcpkgfox-0.16.67.dist-info}/METADATA +1 -1
- {bcpkgfox-0.16.66.dist-info → bcpkgfox-0.16.67.dist-info}/RECORD +6 -6
- {bcpkgfox-0.16.66.dist-info → bcpkgfox-0.16.67.dist-info}/WHEEL +0 -0
- {bcpkgfox-0.16.66.dist-info → bcpkgfox-0.16.67.dist-info}/entry_points.txt +0 -0
- {bcpkgfox-0.16.66.dist-info → bcpkgfox-0.16.67.dist-info}/top_level.txt +0 -0
bcpkgfox/invoke_api.py
CHANGED
|
@@ -262,17 +262,32 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
262
262
|
|
|
263
263
|
except:
|
|
264
264
|
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
265
|
+
|
|
265
266
|
# Request the code
|
|
266
267
|
for _ in range(50): # Wait the extension to load
|
|
267
268
|
|
|
268
269
|
try:
|
|
269
|
-
tools.find_element_with_wait(By.XPATH, '
|
|
270
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]', timeout=1).send_keys('eliezer@bcfox.com.br')
|
|
270
271
|
time.sleep(1)
|
|
271
272
|
break
|
|
272
273
|
except:
|
|
273
274
|
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
274
275
|
|
|
275
|
-
|
|
276
|
+
# Envia o código pro email, o for é só para tratativa de bugs
|
|
277
|
+
for _ in range(10):
|
|
278
|
+
try:
|
|
279
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite aqui o código que enviamos para o seu e-mail"]', timeout=1)
|
|
280
|
+
break
|
|
281
|
+
|
|
282
|
+
except:
|
|
283
|
+
try:
|
|
284
|
+
element = tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]', timeout=1)
|
|
285
|
+
element.clear()
|
|
286
|
+
element.send_keys('eliezer@bcfox.com.br')
|
|
287
|
+
tools.find_element_with_wait(By.XPATH, '//button').click()
|
|
288
|
+
time.sleep(1)
|
|
289
|
+
except:
|
|
290
|
+
break
|
|
276
291
|
|
|
277
292
|
# Attempts the new codes until success or requests limit
|
|
278
293
|
for _ in range(code_timeout):
|
|
@@ -285,7 +300,10 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
285
300
|
CODE = response['CODIGO']
|
|
286
301
|
ID = response['ID']
|
|
287
302
|
|
|
288
|
-
tools.find_element_with_wait(By.XPATH, '//input[@type="password"]')
|
|
303
|
+
element = tools.find_element_with_wait(By.XPATH, '//input[@type="password"]')
|
|
304
|
+
element.clear()
|
|
305
|
+
element.send_keys(CODE)
|
|
306
|
+
|
|
289
307
|
for _ in range(10):
|
|
290
308
|
try:
|
|
291
309
|
tools.find_element_with_wait(By.XPATH, '//div/div[2]/button', timeout=2).click()
|
|
@@ -294,7 +312,7 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
294
312
|
break
|
|
295
313
|
|
|
296
314
|
# Check the code result
|
|
297
|
-
for _ in range(
|
|
315
|
+
for _ in range(30):
|
|
298
316
|
|
|
299
317
|
# Correct
|
|
300
318
|
try:
|
|
@@ -310,7 +328,7 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
310
328
|
# Wrong
|
|
311
329
|
try:
|
|
312
330
|
tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'Senha inválida')]", timeout=1)
|
|
313
|
-
tools.find_element_with_wait(By.XPATH, "//button[text()='Voltar']", timeout=1)
|
|
331
|
+
tools.find_element_with_wait(By.XPATH, "//button[text()='Voltar']", timeout=1).click()
|
|
314
332
|
code_insertion = False
|
|
315
333
|
break
|
|
316
334
|
|
|
@@ -329,15 +347,7 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
329
347
|
raise TimeoutError('Código WHOOM não chegou dentro do timeout estabelecido')
|
|
330
348
|
|
|
331
349
|
# Selects the system to access
|
|
332
|
-
|
|
333
|
-
lines = tools.find_elements_with_wait(By.XPATH, '//*[@id="root"]/div[2]/div/div[1]/div/div[2]/div/div/div', timeout=5)
|
|
334
|
-
except:
|
|
335
|
-
try:
|
|
336
|
-
lines = tools.find_elements_with_wait(By.XPATH, '//*[@id="root"]/div[2]/div/div[2]/div/div[2]/div/div/div', timeout=5)
|
|
337
|
-
except Exception as e:
|
|
338
|
-
mostrar_mensagem('Não conseguiu achar o sistema no certificado')
|
|
339
|
-
print(f'{e}\n\n\n\n\n\n')
|
|
340
|
-
raise ValueError('Não conseguiu achar o sistema no certificado') from e
|
|
350
|
+
lines = tools.find_elements_with_wait(By.XPATH, '//div[@role="menu"]//div[@role="menuitem"]')
|
|
341
351
|
|
|
342
352
|
finded = False
|
|
343
353
|
div_list = []
|
|
@@ -402,42 +412,45 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
402
412
|
|
|
403
413
|
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
404
414
|
|
|
405
|
-
|
|
406
|
-
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=10).send_keys(self.system)
|
|
407
|
-
return
|
|
415
|
+
for _ in range(10):
|
|
408
416
|
|
|
409
|
-
|
|
417
|
+
# Caso a extensão já esteja instalada
|
|
418
|
+
try:
|
|
419
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=1).send_keys(self.system)
|
|
420
|
+
return
|
|
421
|
+
except: pass
|
|
422
|
+
|
|
423
|
+
# Caso a extensão não esteja instala
|
|
424
|
+
if 'This page has been blocked by Chrome' in driver.page_source:
|
|
425
|
+
break
|
|
410
426
|
|
|
411
427
|
if 'eliezer@bcfox.com.br' in self.driver.page_source:
|
|
412
428
|
tools.find_element_with_wait(By.XPATH, "//span[text()='alterar']").click()
|
|
413
429
|
return
|
|
414
430
|
|
|
415
|
-
|
|
416
|
-
|
|
431
|
+
# Abrir uma nova aba
|
|
432
|
+
self.driver.execute_script("window.open('');")
|
|
417
433
|
|
|
418
|
-
|
|
419
|
-
|
|
434
|
+
# Fechar a aba original
|
|
435
|
+
self.driver.close()
|
|
420
436
|
|
|
421
|
-
|
|
422
|
-
|
|
437
|
+
# Mudar para a nova aba
|
|
438
|
+
self.driver.switch_to.window(self.driver.window_handles[-1])
|
|
423
439
|
|
|
424
|
-
|
|
440
|
+
time.sleep(1)
|
|
425
441
|
|
|
426
|
-
|
|
442
|
+
self.driver.get("https://chromewebstore.google.com/detail/whom-gerenciador-de-certi/lnidijeaekolpfeckelhkomndglcglhh")
|
|
427
443
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
except Exception as e:
|
|
431
|
-
return
|
|
432
|
-
time.sleep(5)
|
|
444
|
+
tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'no Chrome') or contains(text(), 'Usar') or contains(text(), 'Add to Chrome')]").click()
|
|
445
|
+
time.sleep(5)
|
|
433
446
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
447
|
+
# Envia TAB e ENTER do teclado físico
|
|
448
|
+
pyautogui.press('tab')
|
|
449
|
+
time.sleep(0.5)
|
|
450
|
+
pyautogui.press('enter')
|
|
451
|
+
time.sleep(5)
|
|
439
452
|
|
|
440
|
-
|
|
453
|
+
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
441
454
|
|
|
442
455
|
tools = tool()
|
|
443
456
|
api = invokes_whoom()
|
|
@@ -4,10 +4,10 @@ bcpkgfox/cli.py,sha256=6k4GNZimGKKkntuzy54EDKuvc_N0XKWr2N_Ho7nINxw,33497
|
|
|
4
4
|
bcpkgfox/exec_file.py,sha256=fl_Do2SlF7JuXazpNTod-e_0WZUk355fbd7ustQvi40,3728
|
|
5
5
|
bcpkgfox/find_elements.py,sha256=oeB-73LqMLoKchozPXuxRkThBju9IgUKqbgU-2AAq0s,23027
|
|
6
6
|
bcpkgfox/get_driver.py,sha256=ohimk9E2hL6T35IXv0XX0uvWDGCUZvZDlPMnuRjV1R0,30490
|
|
7
|
-
bcpkgfox/invoke_api.py,sha256=
|
|
7
|
+
bcpkgfox/invoke_api.py,sha256=QrvQ1goq9IQ1iQvyckCRZuENFPtFiqMQdEI8G1QrFC4,17383
|
|
8
8
|
bcpkgfox/system.py,sha256=3lyOWx893T6KiAI-jDv7zAo3oKPf0Q5CLgZ8TeFd0Do,7901
|
|
9
|
-
bcpkgfox-0.16.
|
|
10
|
-
bcpkgfox-0.16.
|
|
11
|
-
bcpkgfox-0.16.
|
|
12
|
-
bcpkgfox-0.16.
|
|
13
|
-
bcpkgfox-0.16.
|
|
9
|
+
bcpkgfox-0.16.67.dist-info/METADATA,sha256=23kqj8deqXFfDTwuOvdRtadwOYQBM4_8rtI2AqrPARM,1912
|
|
10
|
+
bcpkgfox-0.16.67.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
11
|
+
bcpkgfox-0.16.67.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
|
|
12
|
+
bcpkgfox-0.16.67.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
|
|
13
|
+
bcpkgfox-0.16.67.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|