Skip to content

Commit

Permalink
get sync github to work
Browse files Browse the repository at this point in the history
  • Loading branch information
Shom770 committed Sep 19, 2023
1 parent b3e35ad commit b48f80f
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 34 deletions.
13 changes: 3 additions & 10 deletions falconscoutcore/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -241,23 +242,15 @@ 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,
)

contents = repo.get_contents(CONFIG["repo_config"]["update_qualitative_json"])
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,
)

Expand Down
123 changes: 99 additions & 24 deletions falconscoutcore/data/2023new_qualitative_data.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
]

0 comments on commit b48f80f

Please sign in to comment.