diff --git a/README.md b/README.md index b593354..47e1969 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ # Showoff - A simple sports stats tracker -![Version](https://img.shields.io/badge/version-1.1.1-blue) +![Version](https://img.shields.io/badge/version-1.1.2-blue) ![Python](https://img.shields.io/badge/python-3.9+-green) ![License](https://img.shields.io/badge/license-MIT-orange) ![made with love](https://img.shields.io/badge/made%20with-%3C3-red) +> **Versions below v1.1.2 are not-supported** + Showoff is a simple sports self-statistics tracker for players or their coaches, written to be easy to use and to be informational. Currently supports basketball, soccer. +You can also offer your sport, or help with existing ones ## Requirements @@ -26,9 +29,9 @@ You can run showoff using [binaries for your system](https://github.com/worthywo | Platform | Status | Latest | |----------|-----------------------------|--------------------| -| Windows | Partial-support(Has issues) | v1.1.1 | -| Linux | Ready ✅ | v1.1.1 | -| macOS | Could be later ⚠️ | No builds uploaded | +| Windows | Ready ✅ | v1.1.2 | +| Linux | Ready ✅ | v1.1.2 | +| macOS | Ready ✅ | v1.1.2 | 1. Download the latest binary files for your system: - [Latest Release](https://github.com/worthyworm/showoff/releases/latest) @@ -36,7 +39,7 @@ You can run showoff using [binaries for your system](https://github.com/worthywo 2. Unpack the binary in a convenient folder. 3. Launch: - > Note for windows users: + > Note for Windows users: > > Windows defender may detect showoff as a malware, so it is recommended to disable defender / add showoff to exceptions - **Windows**: Double-click 'showoff.exe' @@ -50,7 +53,6 @@ You can run showoff using [binaries for your system](https://github.com/worthywo ### Using the source code -> Note: Using the source code is NOT recommended. The code is being worked on and some features may be unfinished 1. Clone the repository: diff --git a/locales/lang_en.json b/locales/lang_en.json index a6e1469..819cba9 100644 --- a/locales/lang_en.json +++ b/locales/lang_en.json @@ -50,5 +50,6 @@ "all_time": "ALL-TIME", "per_game": "PER-GAME", "value": "VALUE", - "change_lang": "Change language" + "change_lang": "Change language", + "unsupported_version": "Unsupported save version\nFor more information, see the readme" } \ No newline at end of file diff --git a/locales/lang_ru.json b/locales/lang_ru.json index a506828..5a27ea5 100644 --- a/locales/lang_ru.json +++ b/locales/lang_ru.json @@ -50,5 +50,6 @@ "all_time": "ВСЕ-ВРЕМЯ", "per_game": "ЗА-ИГРУ", "value": "ЗНАЧ", - "change_lang": "Смена языка" + "change_lang": "Смена языка", + "unsupported_version": "Неподдерживаемая версия сохранения\nДля большей информации, смотрите README.md" } \ No newline at end of file diff --git a/source/__init__.py b/source/__init__.py index 15b8b11..8571e94 100644 --- a/source/__init__.py +++ b/source/__init__.py @@ -11,6 +11,4 @@ INFO = f""" {LOGO} v{VERSION} - meeko 2026 -Warning: Due to some changes, savefiles are not compatible with previous versions. -Soon there will be a new version that is fully backwards-compatible. """ diff --git a/source/data_handler.py b/source/data_handler.py index ef300d4..c422b90 100644 --- a/source/data_handler.py +++ b/source/data_handler.py @@ -2,6 +2,7 @@ import json import sys from ui_handler import texts +from __init__ import VERSION while True: try: @@ -31,9 +32,13 @@ try: with open('basketball.json', 'r', encoding='utf-8') as f: db = json.load(f) + if tuple(map(int, db['version'].split('.'))) < (1, 1, 2): + print(f'{texts["unsupported_version"]}: {db["version"]}version') + input('Enter to continue') + sys.exit(1) except FileNotFoundError: player = input(f"{texts["enter_name"]}: ") - db = {"player": player, "games": []} + db = {"version": VERSION, "player": player, "games": []} except json.decoder.JSONDecodeError as e: print(f"The file is not a valid Json file or is empty\nERROR: {e}") input(f'{texts["enter_to_continue"]}') @@ -47,9 +52,13 @@ try: with open('soccer.json', 'r', encoding='utf-8') as f: db = json.load(f) + if tuple(map(int, db['version'].split('.'))) < (1, 1, 2): + print(f'{texts["unsupported_version"]}: {db["version"]}') + input('Enter to continue') + sys.exit(1) except FileNotFoundError: player = input(f'{texts["enter_name"]}: ') - db = {"player": player, "games": []} + db = {"version": VERSION, "player": player, "games": []} except Exception as e: print(f'ERROR: {e}') input(f'{texts["enter_to_continue"]}') diff --git a/source/export_handler.py b/source/export_handler.py index 88413e2..f6aab21 100644 --- a/source/export_handler.py +++ b/source/export_handler.py @@ -43,9 +43,9 @@ def export_to_csv(sport, filename=f'export_{now.strftime("%d%m%Y_%H%M%S")}.csv') 'BLK': 'blocks', 'STL': 'steals', 'PF': 'personal_fouls', - 'Missed Free Throws': 'missedFT', + 'Missed Free Throws': 'missed_free_throws', 'Turnovers': 'turnovers', - 'Result': 'Won' + 'Result': 'result' } with open(filename, 'w', newline='', encoding='utf-8') as csvf: @@ -73,7 +73,7 @@ def export_to_csv(sport, filename=f'export_{now.strftime("%d%m%Y_%H%M%S")}.csv') print(f'{texts["no_games"]}') return - headers = ['Date', 'POS', 'MIN', 'GOALS', 'AST', 'SHOTS', 'Yellow cards', 'Red cards', 'Fouls', 'Result'] + headers = ['Date', 'POS', 'MIN', 'GOALS', 'AST', 'SHOTS', 'SAVES', 'STEALS', 'Yellow cards', 'Red cards', 'Fouls', 'Result'] key_mapping = { 'Date': 'date', @@ -82,10 +82,12 @@ def export_to_csv(sport, filename=f'export_{now.strftime("%d%m%Y_%H%M%S")}.csv') 'GOALS': 'goals', 'AST': 'assists', 'SHOTS': 'shots', + 'SAVES': 'saves', + 'STEALS': 'steals', 'Yellow cards': 'yellow_cards', 'Red cards': 'red_cards', 'Fouls': 'fouls', - 'Result': 'Won' + 'Result': 'result' } with open(filename, 'w', newline='', encoding='utf-8') as csvf: diff --git a/source/statistics_handler.py b/source/statistics_handler.py index 64630fe..c72d7c0 100644 --- a/source/statistics_handler.py +++ b/source/statistics_handler.py @@ -84,7 +84,7 @@ def show_stats(match_index): ["Assists", str(games[match_index]["assists"])], ["Rebounds", str(games[match_index]["rebounds"])], ["Blocks", str(games[match_index]["blocks"])], ["Steals", str(games[match_index]["steals"])], ["Personal fouls", str(games[match_index]["personal_fouls"])], ["Missed Free Throws", str(games[match_index]["missed_free_throws"])], - ["Turnovers", str(games[match_index]["turnovers"])], ["Won", str(games[match_index]["result"])] + ["Turnovers", str(games[match_index]["turnovers"])], ["Result", str(games[match_index]["result"])] ] print(f"{f'{texts["stat"]}':<20} {f'{texts["value"]}'}") print("─" * 35) @@ -97,7 +97,7 @@ def show_stats(match_index): ["Assists", str(games[match_index]["assists"])], ["Shots", str(games[match_index]["shots"])], ["Saves", str(games[match_index]["saves"])], ["Steals", str(games[match_index]["steals"])], ["Yellow Cards", str(games[match_index]["yellow_cards"])], ["Red Cards", str(games[match_index]["red_cards"])], - ["Won", str(games[match_index]["result"])] + ["Result", str(games[match_index]["result"])] ] print(f"{f'{texts["stat"]}':<20} {f'{texts["value"]}'}") print("─" * 35)