Skip to content
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

Add Deadlines to Output #114

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feature: parse deadlines in gg yml
  • Loading branch information
burgess01 committed Mar 1, 2023
commit 785626ddc3a68e4929742dbf29ba0b619f213983
18 changes: 13 additions & 5 deletions gatorgrade/input/in_file_path.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Generates a list of commands to be run through gatorgrader."""

import datetime
from collections import namedtuple
from pathlib import Path
from typing import Any
Expand Down Expand Up @@ -39,11 +40,18 @@ def parse_yaml_file(file_path: Path) -> List[Any]:
def reformat_yaml_data(data):
"""Reformat the raw data from a YAML file into a list of tuples."""
reformatted_data = []
if len(data) == 2:
setup_commands = data.pop(0) # Removes the setup commands
run_setup(setup_commands)
add_checks_to_list(None, data[0], reformatted_data)
return reformatted_data
deadline = None
i = 0
data_values = len(data)
if data_values >= 2:
for i in range(data_values - 1):
if "setup" in data[i]:
setup_commands = data[i]
run_setup(setup_commands)
elif "deadline" in data[i]:
deadline = data[i]["deadline"]
add_checks_to_list(None, data[data_values - 1], reformatted_data)
return reformatted_data, deadline


def add_checks_to_list(path, data_list, reformatted_data) -> List[CheckData]:
Expand Down