Skip to content

Commit 6881859

Browse files
committed
ran isort . and black . to correctly format everything
1 parent bfdacdf commit 6881859

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

in2lambda/api/set.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ def to_json(self, output_dir: str) -> None:
124124
Question 1's title: Question 1
125125
126126
"""
127-
127+
128128
from in2lambda.json_convert import json_convert
129+
129130
json_convert.main(self, output_dir)
130131

131132
def set_name(self, name: str) -> None:

in2lambda/filters/PartSolPartSol/filter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ def pandoc_filter(
4949
if not isinstance(item, pf.Div)
5050
]
5151
set.current_question.add_part_text("\n".join(part))
52-
set.current_question.add_solution(
53-
pandoc_filter.solutions.popleft()
54-
)
52+
set.current_question.add_solution(pandoc_filter.solutions.popleft())
5553

5654
if isinstance(elem, pf.Div):
5755
pandoc_filter.solutions.append(pf.stringify(elem))

in2lambda/json_convert/json_convert.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@ def _zip_sorted_folder(folder_path, zip_path):
2020
folder_path: The path to the folder to zip.
2121
zip_path: The path where the zip file will be created.
2222
"""
23-
with zipfile.ZipFile(zip_path, 'w') as zf:
23+
with zipfile.ZipFile(zip_path, "w") as zf:
2424
for root, dirs, files in os.walk(folder_path):
2525
# Sort files for deterministic, alphabetical order
2626
for file in sorted(files):
2727
abs_path = os.path.join(root, file)
2828
rel_path = os.path.relpath(abs_path, folder_path)
2929
zf.write(abs_path, arcname=rel_path)
3030

31+
3132
def converter(
32-
question_template: dict[str, Any], set_template: dict[str, Any], SetQuestions: Set, output_dir: str
33+
question_template: dict[str, Any],
34+
set_template: dict[str, Any],
35+
SetQuestions: Set,
36+
output_dir: str,
3337
) -> None:
3438
"""Turns a set of question objects into Lambda Feedback JSON.
3539
@@ -48,7 +52,6 @@ def converter(
4852
output_question = os.path.join(output_dir, set_name)
4953
os.makedirs(output_question, exist_ok=True)
5054

51-
5255
set_template["name"] = set_name
5356
set_template["description"] = set_description
5457
# create the set file
@@ -83,7 +86,9 @@ def converter(
8386
)
8487

8588
# Output file
86-
filename = "question_" + str(i).zfill(3) + "_" + output['title'].replace(" ", "_")
89+
filename = (
90+
"question_" + str(i).zfill(3) + "_" + output["title"].replace(" ", "_")
91+
)
8792

8893
# write questions into directory
8994
with open(f"{output_question}/{filename}.json", "w") as file:

0 commit comments

Comments
 (0)