From b48f80f57b054bad1462eba46a77557d96272107 Mon Sep 17 00:00:00 2001 From: Shom770 <82843611+Shom770@users.noreply.github.com> Date: Mon, 18 Sep 2023 22:01:56 -0400 Subject: [PATCH] get sync github to work --- falconscoutcore/app.py | 13 +- .../data/2023new_qualitative_data.json | 123 ++++++++++++++---- 2 files changed, 102 insertions(+), 34 deletions(-) diff --git a/falconscoutcore/app.py b/falconscoutcore/app.py index fcf9f44..3d4965d 100644 --- a/falconscoutcore/app.py +++ b/falconscoutcore/app.py @@ -44,6 +44,7 @@ def _convert_string_to_proper_type(value: str) -> Any: return value + def _process_data(*data: list[str], status_message_col) -> None: """Takes raw data from a scanned QR code and processes it into a dictionary before writing it back to the data file. @@ -241,7 +242,7 @@ def sync_to_github(success_col) -> None: repo.update_file( contents.path, f'updated data @ {datetime.datetime.now().strftime("%m/%d/%Y, %H:%M:%S")}', - str(file_json_data), + str(file_json_data).replace("'", '"'), contents.sha, ) @@ -249,15 +250,7 @@ def sync_to_github(success_col) -> None: repo.update_file( contents.path, f'updated data @ {datetime.datetime.now().strftime("%m/%d/%Y, %H:%M:%S")}', - str(qualitative_json_data), - contents.sha, - ) - - contents = repo.get_contents(CONFIG["repo_config"]["update_csv"]) - repo.update_file( - contents.path, - f'updated data @ {datetime.datetime.now().strftime("%m/%d/%Y, %H:%M:%S")}', - str(file_csv_data), + str(qualitative_json_data).replace("'", '"'), contents.sha, ) diff --git a/falconscoutcore/data/2023new_qualitative_data.json b/falconscoutcore/data/2023new_qualitative_data.json index d89950d..a358ae1 100644 --- a/falconscoutcore/data/2023new_qualitative_data.json +++ b/falconscoutcore/data/2023new_qualitative_data.json @@ -1,27 +1,102 @@ [ { - "ScoutId":"shayaan", - "MatchKey":"qm,1", - "Alliance":"red", - "DriverStation":"1", - "TeamNumber":4099.0, - "AutoPieces":2.0, - "AutoStartingPosition":"Cable protector side", - "AutoEngaged":"true", - "AutoIntakeAccuracy":"false", - "AutoScoringAccuracy":"Great", - "AutoDrivingSkills":"true", - "AutoNotes":"", - "TeleopPieces":2.0, - "TeleopPath":"Cable protector side to loading zone", - "TeleopAligningSpeed":"Slow", - "TeleopCommunitySkill":"Smoothly", - "TeleopIntakingLocation":"Ground", - "Disabled":"true", - "Tippy":"true", - "DriverRating":"Fluid", - "ConeIntakingSkill":"Very Good", - "CubeIntakingSkill":"Good", - "SubstationSpeed":"Poor" + "ScoutId": "Shayaan", + "MatchKey": "qm1", + "Alliance": "red", + "DriverStation": "", + "TeamNumber": 4099, + "AutoPieces": 2, + "AutoStartingPosition": "Cable protector side", + "AutoEngaged": "true", + "AutoIntakeAccuracy": "false", + "AutoScoringAccuracy": "Decent", + "AutoDrivingSkills": "true", + "AutoNotes": "", + "TeleopPieces": 3, + "TeleopPath": "No specific path", + "TeleopAligningSpeed": "Quick", + "TeleopCommunitySkill": "Smoothly", + "TeleopIntakingLocation": "Double substation", + "Disabled": "true", + "Tippy": "true", + "DriverRating": "Very Fluid", + "ConeIntakingSkill": "Average", + "CubeIntakingSkill": "Poor", + "SubstationSpeed": "Poor" + }, + { + "ScoutId": "Shayaan", + "MatchKey": "qm2", + "Alliance": "red", + "DriverStation": "", + "TeamNumber": 4099, + "AutoPieces": 4, + "AutoStartingPosition": "Charging station", + "AutoEngaged": "false", + "AutoIntakeAccuracy": "true", + "AutoScoringAccuracy": "Okay", + "AutoDrivingSkills": "false", + "AutoNotes": "", + "TeleopPieces": 3, + "TeleopPath": "No specific path", + "TeleopAligningSpeed": "Fast", + "TeleopCommunitySkill": "Well", + "TeleopIntakingLocation": "Ground", + "Disabled": "true", + "Tippy": "false", + "DriverRating": "Fluid", + "ConeIntakingSkill": "Poor", + "CubeIntakingSkill": "Good", + "SubstationSpeed": "Very Good" + }, + { + "ScoutId": "Shayaan", + "MatchKey": "qm3", + "Alliance": "blue", + "DriverStation": "", + "TeamNumber": 4099, + "AutoPieces": 3, + "AutoStartingPosition": "Loading zone side", + "AutoEngaged": "true", + "AutoIntakeAccuracy": "true", + "AutoScoringAccuracy": "Great", + "AutoDrivingSkills": "false", + "AutoNotes": "", + "TeleopPieces": 7, + "TeleopPath": "No cable protector side to loading zone", + "TeleopAligningSpeed": "Quick", + "TeleopCommunitySkill": "Smoothly", + "TeleopIntakingLocation": "Ground", + "Disabled": "true", + "Tippy": "false", + "DriverRating": "Very Fluid", + "ConeIntakingSkill": "Very Good", + "CubeIntakingSkill": "Very Good", + "SubstationSpeed": "Very Good" + }, + { + "ScoutId": "shayaan", + "MatchKey": "qm5", + "Alliance": "red", + "DriverStation": "", + "TeamNumber": 4099, + "AutoPieces": 0, + "AutoStartingPosition": "Cable protector side", + "AutoEngaged": "true", + "AutoIntakeAccuracy": "false", + "AutoScoringAccuracy": "Lousy", + "AutoDrivingSkills": "true", + "AutoNotes": "", + "TeleopPieces": 2, + "TeleopPath": "Cable protector side to loading zone", + "TeleopAligningSpeed": "Fast", + "TeleopCommunitySkill": "Smoothly", + "TeleopIntakingLocation": "Ground", + "Disabled": "true", + "Tippy": "true", + "DriverRating": "Average", + "ConeIntakingSkill": "Very Poor", + "CubeIntakingSkill": "Poor", + "SubstationSpeed": "Average" } -] +] \ No newline at end of file