diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..77b48d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,133 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +#Project-generated files +config.json +vencedores.txt \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..e6adf3f --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.4 \ No newline at end of file diff --git a/src/constants/constants.py b/src/constants/constants.py index 0dd5add..79c6b44 100644 --- a/src/constants/constants.py +++ b/src/constants/constants.py @@ -144,7 +144,16 @@ WARNING = { o arquivo config.json Pressione ENTER para jogar! - """} + """, + "newversion": """ + Há uma nova versão disponível! + Atualizações trazem melhorias de performance e jogabilidade! + + Faça download da nova versão aqui: + https://github.com/nanometer5088/bingo/archive/refs/heads/main.zip + + Pressione ENTER para continuar + """} GAME = { "presskey": "Selecione outra cartela (1, 2, 3 ou 4) ou pressione ENTER para sortear "} diff --git a/src/constants/constantsen.py b/src/constants/constantsen.py index 5702a45..24c3884 100644 --- a/src/constants/constantsen.py +++ b/src/constants/constantsen.py @@ -144,7 +144,16 @@ WARNING = { the config.json file Press ENTER to play! - """} + """, + "newversion": """ + There's a new version available! + Updates bring performance and gameplay improvements! + + Download the new version here: + https://github.com/nanometer5088/bingo/archive/refs/heads/main.zip + + Pressione ENTER para continuar + """} GAME = { "presskey": "Select another card (1, 2, 3 or 4) or press ENTER to draw "} diff --git a/src/init.py b/src/init.py index c17bd26..3259a32 100644 --- a/src/init.py +++ b/src/init.py @@ -38,6 +38,18 @@ def inicio(locale): #Início do programa e indrodução para o usuário os.system("cls || clear") x = input(locale.START["intro"]) + + #Verifica por atualizações, e avisa o usuário caso encontre alguma + try: + import requests + data = requests.get("https://raw.githubusercontent.com/nanometer5088/bingo/main/VERSION") + version = open('VERSION', 'r', encoding='utf=8') + if version.readline().rstrip() < (data.text): + os.system("cls || clear") + input(locale.WARNING["newversion"]) + except requests.exceptions.ConnectionError: + print() + #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