bcpkgfox 0.17.5__py3-none-any.whl → 0.17.6__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.
- bcpkgfox/invoke_api.py +106 -117
- bcpkgfox-0.17.6.dist-info/METADATA +53 -0
- {bcpkgfox-0.17.5.dist-info → bcpkgfox-0.17.6.dist-info}/RECORD +6 -7
- {bcpkgfox-0.17.5.dist-info → bcpkgfox-0.17.6.dist-info}/WHEEL +1 -1
- bcpkgfox/exec_file.py +0 -100
- bcpkgfox-0.17.5.dist-info/METADATA +0 -45
- {bcpkgfox-0.17.5.dist-info → bcpkgfox-0.17.6.dist-info}/entry_points.txt +0 -0
- {bcpkgfox-0.17.5.dist-info → bcpkgfox-0.17.6.dist-info}/top_level.txt +0 -0
bcpkgfox/invoke_api.py
CHANGED
|
@@ -167,7 +167,7 @@ def invoke_api_proc_log(link, id_robo, token):
|
|
|
167
167
|
"POST", link, json=payload, headers=headers)
|
|
168
168
|
print(f"\n{responseinsert.json()}")
|
|
169
169
|
|
|
170
|
-
def login_2fac(driver, certificate, system, token, code_timeout=
|
|
170
|
+
def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
171
171
|
import requests
|
|
172
172
|
import pyautogui
|
|
173
173
|
from . import mostrar_mensagem
|
|
@@ -332,13 +332,9 @@ def login_2fac(driver, certificate, system, token, code_timeout=10):
|
|
|
332
332
|
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
333
333
|
|
|
334
334
|
def codes_2_fac(self):
|
|
335
|
-
|
|
336
|
-
element_email = '//input[contains(@placeholder,"Insira aqui o seu email") or contains(@placeholder,"e-mail")]'
|
|
337
|
-
email = 'eliezer@bcfox.com.br'
|
|
338
|
-
element_code = '//input[contains(@placeholder,"Digite aqui o código que enviamos para o seu e-mail") or contains(@placeholder,"código") or contains(@type,"password")]'
|
|
339
|
-
element_submit ='//button[contains(@type, "submit")]'
|
|
335
|
+
|
|
340
336
|
try:
|
|
341
|
-
tools.find_element_with_wait(By.XPATH,
|
|
337
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=2).send_keys(self.system)
|
|
342
338
|
code_insertion = True
|
|
343
339
|
|
|
344
340
|
except:
|
|
@@ -346,9 +342,9 @@ def login_2fac(driver, certificate, system, token, code_timeout=10):
|
|
|
346
342
|
|
|
347
343
|
# Request the code
|
|
348
344
|
for _ in range(50): # Wait the extension to load
|
|
349
|
-
|
|
345
|
+
|
|
350
346
|
try:
|
|
351
|
-
tools.find_element_with_wait(By.XPATH,
|
|
347
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]', timeout=1).send_keys('eliezer@bcfox.com.br')
|
|
352
348
|
time.sleep(1)
|
|
353
349
|
break
|
|
354
350
|
except:
|
|
@@ -357,145 +353,138 @@ def login_2fac(driver, certificate, system, token, code_timeout=10):
|
|
|
357
353
|
# Envia o código pro email, o for é só para tratativa de bugs
|
|
358
354
|
for _ in range(10):
|
|
359
355
|
try:
|
|
360
|
-
tools.find_element_with_wait(By.XPATH,
|
|
356
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite aqui o código que enviamos para o seu e-mail"]', timeout=1)
|
|
361
357
|
break
|
|
362
358
|
|
|
363
359
|
except:
|
|
364
360
|
try:
|
|
365
|
-
element = tools.find_element_with_wait(By.XPATH,
|
|
361
|
+
element = tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]', timeout=1)
|
|
366
362
|
element.clear()
|
|
367
|
-
element.send_keys(
|
|
368
|
-
tools.find_element_with_wait(By.XPATH,
|
|
363
|
+
element.send_keys('eliezer@bcfox.com.br')
|
|
364
|
+
tools.find_element_with_wait(By.XPATH, '//button').click()
|
|
369
365
|
time.sleep(1)
|
|
370
366
|
except:
|
|
371
367
|
break
|
|
372
368
|
|
|
373
369
|
# Attempts the new codes until success or requests limit
|
|
374
370
|
for _ in range(code_timeout):
|
|
375
|
-
|
|
376
|
-
responses = api.invoke_get_codes()
|
|
377
|
-
if not responses:
|
|
378
|
-
time.sleep(2)
|
|
379
|
-
return [], None
|
|
380
|
-
# Try new codes
|
|
381
|
-
code_insertion = False
|
|
382
|
-
for response in responses:
|
|
383
|
-
time.sleep(1)
|
|
371
|
+
responses = api.invoke_get_codes()
|
|
384
372
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
CODE = response['CODIGO']
|
|
389
|
-
ID = response['ID']
|
|
373
|
+
# Try new codes
|
|
374
|
+
code_insertion = False
|
|
375
|
+
for response in responses:
|
|
390
376
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
element.send_keys(CODE)
|
|
394
|
-
button_entrar_click = False
|
|
395
|
-
for _ in range(20):
|
|
396
|
-
try:
|
|
397
|
-
button = tools.find_element_with_wait(By.XPATH, f'{element_submit}', timeout=2)
|
|
398
|
-
if button.get_attribute('disabled'):
|
|
399
|
-
time.sleep(1.5)
|
|
400
|
-
continue
|
|
401
|
-
button.click()
|
|
402
|
-
button_entrar_click = True
|
|
403
|
-
if 'Escolha um certificado' in self.driver.page_source:
|
|
404
|
-
break
|
|
405
|
-
|
|
406
|
-
time.sleep(1)
|
|
407
|
-
except:
|
|
408
|
-
break
|
|
409
|
-
|
|
410
|
-
if int(_) == 20 and button_entrar_click == False:
|
|
411
|
-
raise TimeoutError('Código Whom falhou ao entrar')
|
|
412
|
-
|
|
413
|
-
return responses, ID
|
|
414
|
-
|
|
415
|
-
responses, ID = adicionar_code()
|
|
416
|
-
|
|
417
|
-
if 'Sair' in self.driver.page_source and not 'Verifique seu e-mail' in self.driver.page_source:
|
|
418
|
-
api.invoke_update_status(ID) # FIX: Update
|
|
419
|
-
break
|
|
377
|
+
CODE = response['CODIGO']
|
|
378
|
+
ID = response['ID']
|
|
420
379
|
|
|
421
|
-
|
|
422
|
-
|
|
380
|
+
element = tools.find_element_with_wait(By.XPATH, '//input[@type="password"]')
|
|
381
|
+
element.clear()
|
|
382
|
+
element.send_keys(CODE)
|
|
423
383
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
384
|
+
for _ in range(10):
|
|
385
|
+
try:
|
|
386
|
+
tools.find_element_with_wait(By.XPATH, '//div/div[2]/button', timeout=2).click()
|
|
387
|
+
time.sleep(1)
|
|
388
|
+
except:
|
|
389
|
+
break
|
|
430
390
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
# Wrong
|
|
391
|
+
# Check the code result
|
|
392
|
+
for _ in range(30):
|
|
434
393
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
394
|
+
# Correct
|
|
395
|
+
try:
|
|
396
|
+
# input('\n\n > Selecione o sistema e aperte alguma tecla.')
|
|
397
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=1).send_keys(self.system)
|
|
398
|
+
api.invoke_update_status(ID) #FIX: Update
|
|
399
|
+
code_insertion = True
|
|
400
|
+
break
|
|
441
401
|
|
|
442
|
-
|
|
443
|
-
|
|
402
|
+
except:
|
|
403
|
+
pass
|
|
444
404
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
405
|
+
# Wrong
|
|
406
|
+
try:
|
|
407
|
+
tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'Senha inválida')]", timeout=1)
|
|
408
|
+
tools.find_element_with_wait(By.XPATH, "//button[text()='Voltar']", timeout=1).click()
|
|
409
|
+
code_insertion = False
|
|
410
|
+
break
|
|
448
411
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
for _ in range(30):
|
|
452
|
-
if code_insertion:
|
|
453
|
-
break
|
|
454
|
-
# Correct
|
|
455
|
-
try:
|
|
456
|
-
tools.find_element_with_wait(By.XPATH,"//input[(contains(@name,'certificate') or contains(@placeholder,'certificado')) and not(contains(@type, 'hidden'))]", timeout=1).send_keys(self.certificate)
|
|
457
|
-
list_certific = tools.find_elements_with_wait(By.XPATH,'//div[contains(@role,"option")]')
|
|
458
|
-
list_certific[0].click()
|
|
459
|
-
time.sleep(1)
|
|
460
|
-
code_insertion = True
|
|
461
|
-
break
|
|
462
|
-
except:
|
|
463
|
-
pass
|
|
412
|
+
except:
|
|
413
|
+
pass
|
|
464
414
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
for _ in range(30):
|
|
468
|
-
try:
|
|
469
|
-
# input('\n\n > Selecione o sistema e aperte alguma tecla.')
|
|
470
|
-
tools.find_element_with_wait(By.XPATH, f'{element_sistema}', timeout=1).send_keys(self.system)
|
|
415
|
+
# If the 'new_response' loop succeeds immediately
|
|
416
|
+
if not responses:
|
|
471
417
|
time.sleep(1)
|
|
472
|
-
list_sistemas = tools.find_elements_with_wait(By.XPATH, '//div[contains(@role,"option")]')
|
|
473
|
-
if len(list_sistemas) == 1:
|
|
474
|
-
list_sistemas[0].click()
|
|
475
|
-
code_insertion = True
|
|
476
|
-
break
|
|
477
|
-
else:
|
|
478
|
-
mostrar_mensagem(
|
|
479
|
-
'Mais de um sistema encontrado, verifique o nome do sistema no WHOOM e coloque um nome único na função')
|
|
480
|
-
raise ValueError('Mais de um sistema encontrado, verifique o nome')
|
|
481
|
-
except:
|
|
482
|
-
pass
|
|
483
418
|
|
|
484
419
|
if code_insertion:
|
|
485
420
|
break
|
|
486
421
|
|
|
487
|
-
if code_insertion:
|
|
488
|
-
tools.find_element_with_wait(By.XPATH, f"//button[contains(@data-testid,'submit') or contains(text(), 'Acessar')]").click()
|
|
489
|
-
print('Logado')
|
|
490
|
-
else:
|
|
422
|
+
if not(code_insertion):
|
|
491
423
|
raise TimeoutError('Código WHOOM não chegou dentro do timeout estabelecido')
|
|
492
424
|
|
|
493
|
-
time.sleep(
|
|
425
|
+
time.sleep(4)
|
|
426
|
+
# Selects the system to access
|
|
427
|
+
lines = tools.find_elements_with_wait(By.XPATH, '//div[@role="menu"]//div[@role="menuitem"]')
|
|
428
|
+
|
|
429
|
+
finded = False
|
|
430
|
+
div_list = []
|
|
431
|
+
|
|
432
|
+
# This loop extract the lines with the system name
|
|
433
|
+
for line in lines:
|
|
434
|
+
|
|
435
|
+
titulo_element = line.find_elements(By.XPATH, './span[*[name()="svg"]]')
|
|
436
|
+
|
|
437
|
+
if not titulo_element and not finded:
|
|
438
|
+
continue
|
|
439
|
+
|
|
440
|
+
elif titulo_element and not finded:
|
|
441
|
+
titulo_text = line.find_element(By.XPATH, './span').text
|
|
442
|
+
if self.certificate.lower().strip() in titulo_text.lower().strip():
|
|
443
|
+
finded = True
|
|
444
|
+
continue
|
|
445
|
+
|
|
446
|
+
elif not titulo_element and finded:
|
|
447
|
+
div_list.append(line)
|
|
448
|
+
|
|
449
|
+
elif titulo_element and finded:
|
|
450
|
+
break
|
|
451
|
+
|
|
452
|
+
if not div_list:
|
|
453
|
+
mostrar_mensagem('Não conseguiu achar o sistema no certificado')
|
|
454
|
+
raise ValueError('Não conseguiu achar o sistema no certificado')
|
|
455
|
+
|
|
456
|
+
if len(div_list) == 1:
|
|
457
|
+
time.sleep(1)
|
|
458
|
+
div_list[0].click()
|
|
459
|
+
|
|
460
|
+
# Just do this loop if there are more than one system
|
|
461
|
+
else:
|
|
462
|
+
for div in div_list:
|
|
463
|
+
div_text = div.find_element(By.XPATH, './span').text
|
|
464
|
+
if self.system.lower().strip() not in div_text.lower().strip():
|
|
465
|
+
div_list.remove(div)
|
|
466
|
+
|
|
467
|
+
if len(div_list) == 1:
|
|
468
|
+
div_list[0].click()
|
|
469
|
+
else:
|
|
470
|
+
mostrar_mensagem('Mais de um sistema encontrado, verifique o nome do sistema no WHOOM e coloque um nome único na função')
|
|
471
|
+
raise ValueError('Mais de um sistema encontrado, verifique o nome')
|
|
472
|
+
|
|
473
|
+
# Verifies if the system was opened
|
|
474
|
+
for _ in range(30):
|
|
475
|
+
time.sleep(1)
|
|
476
|
+
if len(self.driver.window_handles) == 1:
|
|
477
|
+
try:
|
|
478
|
+
tools.find_element_with_wait(By.XPATH, "//button[text()='Acessar']", timeout=1).click()
|
|
479
|
+
except:
|
|
480
|
+
time.sleep(1)
|
|
481
|
+
else:
|
|
482
|
+
time.sleep(3)
|
|
483
|
+
break
|
|
484
|
+
|
|
494
485
|
self.driver.switch_to.window(self.driver.window_handles[-1])
|
|
495
486
|
attempt = 0
|
|
496
487
|
while 'whoom' in self.driver.title.strip().lower() and attempt <= 180:
|
|
497
|
-
if 'Sistema temporariamente indisponível. Tente novamente mais tarde.' in self.driver.page_source:
|
|
498
|
-
raise SystemError('Sistema indisponivel no momento.')
|
|
499
488
|
time.sleep(1)
|
|
500
489
|
attempt += 1
|
|
501
490
|
time.sleep(5)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bcpkgfox
|
|
3
|
+
Version: 0.17.6
|
|
4
|
+
Summary: Biblioteca BCFOX
|
|
5
|
+
Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
|
|
6
|
+
Author: BCFOX
|
|
7
|
+
Author-email: bcfox@bcfox.com.br
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: setuptools
|
|
14
|
+
Requires-Dist: pyperclip
|
|
15
|
+
Requires-Dist: pyinstaller
|
|
16
|
+
Requires-Dist: selenium
|
|
17
|
+
Provides-Extra: pynput
|
|
18
|
+
Requires-Dist: pynput; extra == "pynput"
|
|
19
|
+
Provides-Extra: screeninfo
|
|
20
|
+
Requires-Dist: screeninfo; extra == "screeninfo"
|
|
21
|
+
Provides-Extra: pywinauto
|
|
22
|
+
Requires-Dist: pywinauto; extra == "pywinauto"
|
|
23
|
+
Provides-Extra: capmonstercloudclient
|
|
24
|
+
Requires-Dist: capmonstercloudclient; extra == "capmonstercloudclient"
|
|
25
|
+
Provides-Extra: twocaptcha
|
|
26
|
+
Requires-Dist: twocaptcha; extra == "twocaptcha"
|
|
27
|
+
Requires-Dist: 2captcha-python; extra == "twocaptcha"
|
|
28
|
+
Provides-Extra: psutil
|
|
29
|
+
Requires-Dist: psutil; extra == "psutil"
|
|
30
|
+
Provides-Extra: full
|
|
31
|
+
Requires-Dist: undetected-chromedriver; extra == "full"
|
|
32
|
+
Requires-Dist: webdriver-manager; extra == "full"
|
|
33
|
+
Requires-Dist: opencv-python; extra == "full"
|
|
34
|
+
Requires-Dist: pygetwindow; extra == "full"
|
|
35
|
+
Requires-Dist: pyinstaller; extra == "full"
|
|
36
|
+
Requires-Dist: screeninfo; extra == "full"
|
|
37
|
+
Requires-Dist: pyscreeze; extra == "full"
|
|
38
|
+
Requires-Dist: pyautogui; extra == "full"
|
|
39
|
+
Requires-Dist: selenium; extra == "full"
|
|
40
|
+
Requires-Dist: requests; extra == "full"
|
|
41
|
+
Requires-Dist: pymupdf; extra == "full"
|
|
42
|
+
Requires-Dist: Pillow; extra == "full"
|
|
43
|
+
Requires-Dist: psutil; extra == "full"
|
|
44
|
+
Requires-Dist: pynput; extra == "full"
|
|
45
|
+
Dynamic: author
|
|
46
|
+
Dynamic: author-email
|
|
47
|
+
Dynamic: classifier
|
|
48
|
+
Dynamic: description-content-type
|
|
49
|
+
Dynamic: home-page
|
|
50
|
+
Dynamic: provides-extra
|
|
51
|
+
Dynamic: requires-dist
|
|
52
|
+
Dynamic: requires-python
|
|
53
|
+
Dynamic: summary
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
bcpkgfox/__init__.py,sha256=49TPbTUNI6xKcYk4blwseUZQTgHtRcNI1AFEqxSQ3wY,16540
|
|
2
2
|
bcpkgfox/clean.py,sha256=80pJDTGmKmPiq73uL1IWopuxqVJF_bj_RVv-njkpl-A,8946
|
|
3
3
|
bcpkgfox/cli.py,sha256=E1Yahd8jIjUwxM6EMHveDDne5-fh8QeAvAhyATNatEo,33541
|
|
4
|
-
bcpkgfox/exec_file.py,sha256=fl_Do2SlF7JuXazpNTod-e_0WZUk355fbd7ustQvi40,3728
|
|
5
4
|
bcpkgfox/find_elements.py,sha256=oeB-73LqMLoKchozPXuxRkThBju9IgUKqbgU-2AAq0s,23027
|
|
6
5
|
bcpkgfox/get_driver.py,sha256=ohimk9E2hL6T35IXv0XX0uvWDGCUZvZDlPMnuRjV1R0,30490
|
|
7
|
-
bcpkgfox/invoke_api.py,sha256
|
|
6
|
+
bcpkgfox/invoke_api.py,sha256=-aI5DkyNhwDSyven8iL8b71PylP_u3KDAHXRlYQXclA,18996
|
|
8
7
|
bcpkgfox/system.py,sha256=3lyOWx893T6KiAI-jDv7zAo3oKPf0Q5CLgZ8TeFd0Do,7901
|
|
9
|
-
bcpkgfox-0.17.
|
|
10
|
-
bcpkgfox-0.17.
|
|
11
|
-
bcpkgfox-0.17.
|
|
12
|
-
bcpkgfox-0.17.
|
|
13
|
-
bcpkgfox-0.17.
|
|
8
|
+
bcpkgfox-0.17.6.dist-info/METADATA,sha256=0vxTKCMpLOJXygLII9PCiTJCrf9kC_1r13gY8Bda9yY,1893
|
|
9
|
+
bcpkgfox-0.17.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
bcpkgfox-0.17.6.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
|
|
11
|
+
bcpkgfox-0.17.6.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
|
|
12
|
+
bcpkgfox-0.17.6.dist-info/RECORD,,
|
bcpkgfox/exec_file.py
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import subprocess
|
|
2
|
-
import threading
|
|
3
|
-
import argparse
|
|
4
|
-
import time
|
|
5
|
-
import sys
|
|
6
|
-
import os
|
|
7
|
-
|
|
8
|
-
def main():
|
|
9
|
-
|
|
10
|
-
class visual():
|
|
11
|
-
def __init__(self):
|
|
12
|
-
self.RESET = "\033[0m"
|
|
13
|
-
self.DK_ORANGE = "\033[38;5;130m"
|
|
14
|
-
self.Neg = "\033[1m"
|
|
15
|
-
self.hue = 0
|
|
16
|
-
|
|
17
|
-
def hsl_to_rgb(self, h, s, l):
|
|
18
|
-
h = h % 360
|
|
19
|
-
c = (1 - abs(2 * l - 1)) * s
|
|
20
|
-
x = c * (1 - abs((h / 60) % 2 - 1))
|
|
21
|
-
m = l - c / 2
|
|
22
|
-
|
|
23
|
-
if 0 <= h < 60: r, g, b = c, x, 0
|
|
24
|
-
elif 60 <= h < 120: r, g, b = x, c, 0
|
|
25
|
-
elif 120 <= h < 180: r, g, b = 0, c, x
|
|
26
|
-
elif 180 <= h < 240: r, g, b = 0, x, c
|
|
27
|
-
elif 240 <= h < 300: r, g, b = x, 0, c
|
|
28
|
-
elif 300 <= h < 360: r, g, b = c, 0, x
|
|
29
|
-
|
|
30
|
-
r = int((r + m) * 255) ; g = int((g + m) * 255) ; b = int((b + m) * 255)
|
|
31
|
-
return r, g, b
|
|
32
|
-
|
|
33
|
-
def rgb_text(self, text, r, g, b): return f"\033[38;2;{r};{g};{b}m{text}\033[0m"
|
|
34
|
-
|
|
35
|
-
def animate_rgb_text(self, text, delay=0.01):
|
|
36
|
-
r, g, b = self.hsl_to_rgb(self.hue, s=1.0, l=0.5)
|
|
37
|
-
self.hue = (self.hue + 1) % 360
|
|
38
|
-
time.sleep(delay)
|
|
39
|
-
return f" \033[1m{self.rgb_text(text, r, g, b)}\033[0m"
|
|
40
|
-
|
|
41
|
-
class exec_gen():
|
|
42
|
-
def __init__(self):
|
|
43
|
-
self.current_dir = None
|
|
44
|
-
self.target_file = None
|
|
45
|
-
self.file_name = None
|
|
46
|
-
|
|
47
|
-
def preparations(self):
|
|
48
|
-
self.current_dir = os.getcwd()
|
|
49
|
-
|
|
50
|
-
parser = argparse.ArgumentParser(description="Script to generate .exe and preventing bugs")
|
|
51
|
-
parser.add_argument("file", type=str, help="Put the name of file after the command (with the extension '.py')")
|
|
52
|
-
|
|
53
|
-
args = parser.parse_args()
|
|
54
|
-
self.file_name = args.file
|
|
55
|
-
self.target_file = os.path.join(self.current_dir, self.file_name)
|
|
56
|
-
|
|
57
|
-
if not os.path.exists(self.target_file):
|
|
58
|
-
print(f"Error: File '{self.target_file}' does not exist.")
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
def run_pyinstaller(self):
|
|
62
|
-
global process_finished
|
|
63
|
-
|
|
64
|
-
def print_footer():
|
|
65
|
-
"""Função que mantém a mensagem 'Aguarde download' na última linha."""
|
|
66
|
-
while not process_finished:
|
|
67
|
-
sys.stdout.write(f"\r \033[F\r\033[K\033[E {visuals.animate_rgb_text(f" {visuals.Neg}| Gerando executável do '{self.file_name}', aguarde finalização. |{visuals.RESET}")}\n\033[F")
|
|
68
|
-
sys.stdout.flush()
|
|
69
|
-
|
|
70
|
-
process_finished = False
|
|
71
|
-
|
|
72
|
-
command = ["pyinstaller", self.target_file]
|
|
73
|
-
process = subprocess.Popen(
|
|
74
|
-
command,
|
|
75
|
-
stdout=subprocess.PIPE,
|
|
76
|
-
stderr=subprocess.STDOUT,
|
|
77
|
-
universal_newlines=True,
|
|
78
|
-
bufsize=1
|
|
79
|
-
)
|
|
80
|
-
footer_thread = threading.Thread(target=print_footer)
|
|
81
|
-
footer_thread.start()
|
|
82
|
-
|
|
83
|
-
# Lê a saída do PyInstaller em tempo real
|
|
84
|
-
while True:
|
|
85
|
-
output = process.stdout.readline()
|
|
86
|
-
if output == '' and process.poll() is not None:
|
|
87
|
-
break
|
|
88
|
-
if output:
|
|
89
|
-
sys.stdout.write(f"\033[F\r\033[K{output.strip()}\033[K\n\n")
|
|
90
|
-
sys.stdout.flush()
|
|
91
|
-
|
|
92
|
-
process_finished = True
|
|
93
|
-
footer_thread.join()
|
|
94
|
-
|
|
95
|
-
print(f"\r \033[F\r\033[K\033[f\r\033[K\033[2E{visuals.Neg}{visuals.DK_ORANGE}>{visuals.RESET}{visuals.Neg} Executável gerado com sucesso!\n{visuals.RESET}\033[3E")
|
|
96
|
-
|
|
97
|
-
script = exec_gen()
|
|
98
|
-
visuals = visual()
|
|
99
|
-
script.preparations()
|
|
100
|
-
script.run_pyinstaller()
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: bcpkgfox
|
|
3
|
-
Version: 0.17.5
|
|
4
|
-
Summary: Biblioteca BCFOX
|
|
5
|
-
Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
|
|
6
|
-
Author: Guilherme Neri
|
|
7
|
-
Author-email: guilherme.neri@bcfox.com.br
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.6
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
Requires-Dist: setuptools
|
|
14
|
-
Requires-Dist: pyperclip
|
|
15
|
-
Requires-Dist: pyinstaller
|
|
16
|
-
Requires-Dist: selenium
|
|
17
|
-
Provides-Extra: capmonstercloudclient
|
|
18
|
-
Requires-Dist: capmonstercloudclient ; extra == 'capmonstercloudclient'
|
|
19
|
-
Provides-Extra: full
|
|
20
|
-
Requires-Dist: undetected-chromedriver ; extra == 'full'
|
|
21
|
-
Requires-Dist: webdriver-manager ; extra == 'full'
|
|
22
|
-
Requires-Dist: opencv-python ; extra == 'full'
|
|
23
|
-
Requires-Dist: pygetwindow ; extra == 'full'
|
|
24
|
-
Requires-Dist: pyinstaller ; extra == 'full'
|
|
25
|
-
Requires-Dist: screeninfo ; extra == 'full'
|
|
26
|
-
Requires-Dist: pyscreeze ; extra == 'full'
|
|
27
|
-
Requires-Dist: pyautogui ; extra == 'full'
|
|
28
|
-
Requires-Dist: selenium ; extra == 'full'
|
|
29
|
-
Requires-Dist: requests ; extra == 'full'
|
|
30
|
-
Requires-Dist: pymupdf ; extra == 'full'
|
|
31
|
-
Requires-Dist: Pillow ; extra == 'full'
|
|
32
|
-
Requires-Dist: psutil ; extra == 'full'
|
|
33
|
-
Requires-Dist: pynput ; extra == 'full'
|
|
34
|
-
Provides-Extra: psutil
|
|
35
|
-
Requires-Dist: psutil ; extra == 'psutil'
|
|
36
|
-
Provides-Extra: pynput
|
|
37
|
-
Requires-Dist: pynput ; extra == 'pynput'
|
|
38
|
-
Provides-Extra: pywinauto
|
|
39
|
-
Requires-Dist: pywinauto ; extra == 'pywinauto'
|
|
40
|
-
Provides-Extra: screeninfo
|
|
41
|
-
Requires-Dist: screeninfo ; extra == 'screeninfo'
|
|
42
|
-
Provides-Extra: twocaptcha
|
|
43
|
-
Requires-Dist: twocaptcha ; extra == 'twocaptcha'
|
|
44
|
-
Requires-Dist: 2captcha-python ; extra == 'twocaptcha'
|
|
45
|
-
|
|
File without changes
|
|
File without changes
|