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

Allow Configurable Project Name #109

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
feature: add logic for code to work without setup
  • Loading branch information
burgess01 committed Dec 7, 2022
commit ca6bd954359047a021a7c856d1d1c55dbdf2116f
14 changes: 8 additions & 6 deletions gatorgrade/input/in_file_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ def get_assignment_name(file: Path) -> (str):
# change the file path into data to look through
data = parse_yaml_file(file)

# if they have a setup, name, and checks
if len(data) == 3:
# ex. need to go from {'name': 'top\n'} to top: split by space
unedited_assignment_name = str(data.pop(1)).split(" ")[1]
# split by space, grab second, grab before \n
assignment_name = unedited_assignment_name[1:].split("\\")[0]
# if they have a name field
if len(data) > 1:
for i in range(len(data) - 1):
if str(data[i]).includes("{'name':"):
# ex. need to go from {'name': 'top\n'} to top: split by space
unedited_assignment_name = str(data.pop(1))
# split by space, grab second, grab before \n
assignment_name = unedited_assignment_name[9:].split("\\")[0]

return assignment_name

Expand Down