-
Notifications
You must be signed in to change notification settings - Fork 2
Development #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development #71
Conversation
…-blocking notifications for player import, tournament creation, and tournament loading actions. Uses the show_notification utility to provide user feedback, improving the user experience with success and error messages. Falls back to message boxes if notifications fail.
Co-authored-by: Chickaboo <131608268+Chickaboo@users.noreply.github.com>
Fix tournament tab layout getting squished after manual pairing edits
fixed issue with button margins
Introduces a comprehensive exception hierarchy for application errors, refactors player management to use factory methods and standardized data adapters, and updates Dutch Swiss pairing logic to use explicit color constants (BLACK, WHITE) instead of ambiguous variables. Also moves print utilities to a new location, improves player editing and validation, and enhances logging and UI state management throughout the tournament and player tabs.
…dular view classes under the gui/views directory, improving maintainability and separation of concerns. Adds a new PrintOptionsDialog for flexible print selection, enhances the print output for pairings and standings with improved formatting and layout, and introduces gui_utils for shared GUI helpers. Updates mainwindow to use the new views, improves toolbar and placeholder handling, and updates resource paths and icons. Minor code cleanups and docstring adjustments are included.
Add GitHub Actions workflow for Python package publishing
…update version to PEP 440 compliant format
If the clauses are needed, they should be documented and ideally logged.
New logic, AI suggestions implemented. Works on my machine. :)
… when tournament is in progress - Add Record Results button to toolbar alongside Start Tournament button - Show/hide buttons based on tournament state: Start when not started, Record when in progress - Add dynamic separator that appears when tournament exists - Hide Record button when tournament is finished - Update toolbar comment to reflect new functionality
…e row height, and reduce header padding to prevent text truncation and widget clipping
…e Next Round based on tournament state
…ays showing separator between file actions and tournament info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces comprehensive improvements focusing on standardizing exception handling, modernizing player management (especially player data import), and updating build and configuration files for better maintainability.
Changes:
- Introduced a comprehensive exception hierarchy with
GambitPairingExceptionas the base for all custom exceptions - Refactored player data import to use standardized adapters (
cfc_api_to_player_dict,fide_api_to_player_dict) - Added new utility modules for validation, command execution, and API response adaptation
- Refactored tournament management into specialized managers (RoundManager, ResultRecorder, TiebreakCalculator)
- Enhanced UI with new header widget, improved dialogs, and better print functionality
- Updated project metadata and build scripts for new repository location
Reviewed changes
Copilot reviewed 53 out of 71 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| src/gambitpairing/exceptions.py | Comprehensive exception hierarchy with base GambitPairingException |
| src/gambitpairing/utils/validation.py | Reusable validation functions with consistent error handling |
| src/gambitpairing/utils/api_adapters.py | Adapters for converting API responses to Player objects |
| src/gambitpairing/utils/command_runner.py | Utilities for subprocess command execution |
| src/gambitpairing/player/factory.py | Factory pattern for creating Player/FidePlayer instances |
| src/gambitpairing/tournament/*.py | Refactored tournament management with specialized managers |
| src/gambitpairing/gui/dialogs/player_management_dialog.py | Improved player import using standardized adapters |
| src/gambitpairing/gui/views/**/*.py | New view components with unified header widget |
| pyproject.toml | Updated repository URLs and dynamic versioning |
| make_executable.py | Fixed platform-specific executable naming |
Comments suppressed due to low confidence (2)
src/gambitpairing/gui/dialogs/manual_pairing_dialog.py:1419
- This assignment to '_auto_pair_selected_player' is unnecessary as it is redefined before this value is used.
def _auto_pair_selected_player(self, item):
src/gambitpairing/gui/views/standings/standings_view.py:35
- Import of 'create_print_button' is not used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,263 @@ | |||
| import logging | |||
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'logging' is not used.
| import logging |
| Helper class for managing the pairings table in the Tournament tab. | ||
| """ | ||
|
|
||
| import logging |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'logging' is not used.
| import logging | ||
| from typing import List, Optional, Tuple | ||
|
|
||
| from PyQt6 import QtCore, QtGui, QtWidgets |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'QtCore' is not used.
| from PyQt6 import QtCore, QtGui, QtWidgets | ||
| from PyQt6.QtCore import QObject, Qt, QThread, pyqtSignal | ||
|
|
||
| from gambitpairing.gui.gui_utils import get_colored_icon, set_svg_icon |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'set_svg_icon' is not used.
| from gambitpairing.gui.gui_utils import get_colored_icon, set_svg_icon | |
| from gambitpairing.gui.gui_utils import get_colored_icon |
| from gambitpairing.gui.gui_utils import get_colored_icon, set_svg_icon | ||
| from gambitpairing.gui.notification import show_notification | ||
| from gambitpairing.player import Player | ||
| from gambitpairing.player import Player, create_player_from_dict |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'create_player_from_dict' is not used.
| from gambitpairing.player import Player, create_player_from_dict | |
| from gambitpairing.player import Player |
| import logging | ||
| from typing import List, Optional, Tuple | ||
|
|
||
| from PyQt6 import QtCore, QtGui, QtWidgets |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'QtGui' is not used.
| from gambitpairing.constants import ( | ||
| BYE_SCORE, | ||
| DRAW_SCORE, | ||
| LOSS_SCORE, | ||
| RESULT_BLACK_WIN, | ||
| RESULT_DRAW, | ||
| RESULT_WHITE_WIN, | ||
| WIN_SCORE, | ||
| ) |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'LOSS_SCORE' is not used.
Import of 'DRAW_SCORE' is not used.
Import of 'RESULT_BLACK_WIN' is not used.
Import of 'RESULT_DRAW' is not used.
Import of 'RESULT_WHITE_WIN' is not used.
| except Exception: | ||
| pass |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
| except Exception: | |
| pass | |
| except Exception as exc: | |
| logger.exception("Failed to show notification after importing players: %s", exc) |
| notification_type="success", | ||
| ) | ||
| except Exception: | ||
| pass |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
| pass | |
| logger.exception("Failed to show 'new tournament created' notification.") |
| except Exception: | ||
| pass |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
| except Exception: | |
| pass | |
| except Exception as e: | |
| logger.debug( | |
| "Non-fatal error while showing 'tournament loaded' notification", | |
| exc_info=e, | |
| ) |
This pull request introduces several improvements and refactorings across the codebase, focusing on standardizing exception handling, modernizing the player management dialog (especially around player data import), and updating build and configuration files for better maintainability and consistency.
Key changes include:
Exception Handling and Code Structure
exceptions.py, establishingGambitPairingExceptionas the base for all custom exceptions, and organizing related exceptions into logical groups (pairing, tournament, player, result, validation, resource, API, configuration). This enables more robust and maintainable error handling throughout the application.Player Management Dialog Improvements
player_management_dialog.pyto use standardized adapters (cfc_api_to_player_dict,fide_api_to_player_dict), ensuring consistent field mapping and reducing manual field assignments. This improves reliability and maintainability when importing player data from CFC and FIDE APIs. [1] [2]Dialog and UI Enhancements
PrintOptionsDialogto the dialogs module and its public API, making print options accessible in the GUI. [1] [2]Build, Configuration, and Metadata Updates
make_executable.pyto correctly handle platform-specific executable naming and simplify path handling.pyproject.tomlto point to the new GitHub repository location, and set up dynamic versioning using thegambitpairing.__version__attribute. [1] [2]pyproject.toml.These changes collectively improve code maintainability, user experience, and project organization.