Skip to content

Commit

Permalink
Remove print/console statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cherriae committed Jan 9, 2025
1 parent 6b3c0dc commit a2cd865
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
9 changes: 4 additions & 5 deletions app/scout/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def compare_teams():
}

except Exception as team_error:
print(f"Error processing team {team_num}: {str(team_error)}")
# print(f"Error processing team {team_num}: {str(team_error)}")
teams_data[team_num] = {
"team_number": int(team_num),
"error": str(team_error)
Expand All @@ -307,7 +307,7 @@ def compare_teams():
return json.loads(json_util.dumps(teams_data))

except Exception as e:
print(f"Error in compare_teams: {str(e)}")
# print(f"Error in compare_teams: {str(e)}")
return jsonify({"error": "An error occurred while comparing teams"}), 500

@scouting_bp.route("/search")
Expand Down Expand Up @@ -493,7 +493,7 @@ async def search_teams():
)

except Exception as e:
print(f"Error searching teams: {e}")
# print(f"Error searching teams: {e}")
return jsonify({"error": "Failed to fetch team data"}), 500


Expand Down Expand Up @@ -691,8 +691,7 @@ def leaderboard():
teams = list(scouting_manager.db.team_data.aggregate(pipeline))
return render_template("scouting/leaderboard.html", teams=teams, current_sort=sort_type)
except Exception as e:
print(f"Error in leaderboard: {str(e)}")
flash(f"Error loading leaderboard: {str(e)}", "error")
# print(f"Error in leaderboard: {str(e)}")
return render_template("scouting/leaderboard.html", teams=[], current_sort='coral')


Expand Down
10 changes: 1 addition & 9 deletions app/static/js/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ async function compareTeams() {
.map((team, index) => `team${index + 1}=${encodeURIComponent(team)}`)
.join('&');

console.log('Fetching data with query:', queryString);
const response = await fetch(`${API_ENDPOINT}?${queryString}`);
const data = await response.json();

console.log('Received data:', data);


if (!response.ok) {
throw new Error(data.error || 'Failed to fetch team data');
}
Expand All @@ -53,7 +50,6 @@ async function compareTeams() {
}

function displayComparisonResults(teamsData) {
console.log('Starting displayComparisonResults with:', teamsData);
comparisonResults.classList.remove('hidden');

// Display raw scouting data first
Expand Down Expand Up @@ -458,13 +454,10 @@ window.addEventListener('resize', () => {
});

function displayRawData(teamsData) {
console.log('Starting displayRawData with:', teamsData);
const tbody = document.getElementById('raw-data-tbody');
tbody.innerHTML = ''; // Clear existing rows

Object.entries(teamsData).forEach(([teamNum, teamData]) => {
console.log(`Processing team ${teamNum}:`, teamData);

// Check if matches data exists
if (!teamData || !teamData.matches || !Array.isArray(teamData.matches)) {
console.warn(`No matches data for team ${teamNum}`, teamData);
Expand All @@ -473,7 +466,6 @@ function displayRawData(teamsData) {

// Sort matches by match number (most recent first)
const sortedMatches = [...teamData.matches].sort((a, b) => b.match_number - a.match_number);
console.log(`Sorted matches for team ${teamNum}:`, sortedMatches);

sortedMatches.forEach(match => {
const row = document.createElement('tr');
Expand Down

0 comments on commit a2cd865

Please sign in to comment.