Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion solution_runner/commands/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
SOLUTION_PARTS = ("p2", "p1")
SESSION_ID = "session ID"
GITHUB_AUTH_TOKEN = "GitHub auth token"
SOLUTION_FILE_TEMPLATE_PATH = Path(Path(__file__).parent, "solution_template.py")
SOLUTION_TEMPLATES_DIRECTORY = Path(Path(__file__).parent, "solution_templates")

SETUP_COMPLETE_MESSAGE_TEMPLATE = string.Template(
"Created solution file. First file available here: $solution_file_path"
Comment thread
katzuv marked this conversation as resolved.
Expand Down
5 changes: 3 additions & 2 deletions solution_runner/commands/setup_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def _create_files(year_solutions_directory: Path, day: str):
return # If solution directory already exists, don't create new solution files.
raise
for part in consts.SOLUTION_PARTS:
filepath = (solutions_directory / part).with_suffix(FileExtensions.PYTHON)
shutil.copy(consts.SOLUTION_FILE_TEMPLATE_PATH, filepath)
filename = part + FileExtensions.PYTHON
filepath = solutions_directory / filename
shutil.copy((consts.SOLUTION_TEMPLATES_DIRECTORY / filename), filepath)
click.secho(
consts.SETUP_COMPLETE_MESSAGE_TEMPLATE.substitute(solution_file_path=filepath),
Comment thread
katzuv marked this conversation as resolved.
fg="cyan",
Expand Down
14 changes: 0 additions & 14 deletions solution_runner/commands/solution_template.py

This file was deleted.

13 changes: 13 additions & 0 deletions solution_runner/commands/solution_templates/p1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sys

input_example = """
""".strip()


def get_answer(input_text: str):
raise NotImplementedError


if __name__ == "__main__":
puzzle_input = sys.argv[1] if len(sys.argv) > 1 else input_example
print(get_answer(puzzle_input))
12 changes: 12 additions & 0 deletions solution_runner/commands/solution_templates/p2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys

import p1


def get_answer(input_text: str):
raise NotImplementedError


if __name__ == "__main__":
puzzle_input = sys.argv[1] if len(sys.argv) > 1 else p1.input_example
print(get_answer(puzzle_input))