mirror of
https://github.com/ovosimpatico/bingo.git
synced 2026-01-15 16:12:52 -03:00
Update check!
This is a minor update, introducing an update check. If a new version is available, the user will be prompted to update it. Also .gitignore so I don't have to remove files before commiting
This commit is contained in:
133
.gitignore
vendored
Normal file
133
.gitignore
vendored
Normal file
@@ -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
|
||||
@@ -144,6 +144,15 @@ 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 "}
|
||||
|
||||
@@ -144,6 +144,15 @@ 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 "}
|
||||
|
||||
12
src/init.py
12
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
|
||||
|
||||
Reference in New Issue
Block a user