From ec01a8a303d338a088c074573e4cde3d7e20c99a Mon Sep 17 00:00:00 2001 From: nanometer5088 Date: Wed, 9 Nov 2022 18:32:44 -0300 Subject: [PATCH] Fix edge-case bug Requests library is now a requirement - though you probably already have it. Fix bug with chocolatey's version of Python --- VERSION | 2 +- requirements.txt | 3 ++- src/init.py | 26 +++++++++++++------------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/VERSION b/VERSION index 490f510..6b2b6a4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6 \ No newline at end of file +0.61 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index c94be38..3bfa0c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -rich \ No newline at end of file +rich +requests \ No newline at end of file diff --git a/src/init.py b/src/init.py index f6177b6..00f5b84 100644 --- a/src/init.py +++ b/src/init.py @@ -19,18 +19,6 @@ def inicio(): except OSError: pass - # Verifica por atualizações, e avisa o usuário caso encontre alguma - try: - import requests - data = requests.get("https://raw.githubusercontent.com/nanometer5088/quebrando-senhas/main/VERSION") - version = open('VERSION', 'r', encoding='utf=8') - if version.readline().rstrip() < (data.text): - system("cls || clear") - input(WARNING["newversion"]) - version.close() - except requests.exceptions.ConnectionError: - pass - # Detecção e instalação das dependências - Caso não estejam instaladas, # a instalação ocorre e o programa é encerrado. O usuário é avisado para reiniciar # o programa ao finalizar @@ -42,4 +30,16 @@ def inicio(): input(WARNING["libraries"]) system("pip install -r requirements.txt --user") system("cls || clear") - return "instalado" \ No newline at end of file + return "instalado" + + # Verifica por atualizações, e avisa o usuário caso encontre alguma + try: + import requests + data = requests.get("https://raw.githubusercontent.com/nanometer5088/quebrando-senhas/main/VERSION") + version = open('VERSION', 'r', encoding='utf=8') + if version.readline().rstrip() < (data.text): + system("cls || clear") + input(WARNING["newversion"]) + version.close() + except requests.exceptions.ConnectionError: + pass \ No newline at end of file