Skip to content

Commit

Permalink
Interactive via IO support
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed Jul 19, 2024
1 parent 4f30e3f commit b95c7e2
Show file tree
Hide file tree
Showing 17 changed files with 986 additions and 352 deletions.
6 changes: 6 additions & 0 deletions src/sinol_make/commands/gen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from sinol_make.commands.outgen import Command as OutgenCommand
from sinol_make.helpers import parsers
from sinol_make.interfaces.BaseCommand import BaseCommand
from sinol_make.task_type import BaseTaskType


class Command(BaseCommand):
Expand Down Expand Up @@ -44,6 +45,7 @@ def run(self, args: argparse.Namespace):
self.args = args
self.ins = args.only_inputs
self.outs = args.only_outputs
self.task_type = BaseTaskType.get_task_type()
# If no arguments are specified, generate both input and output files.
if not self.ins and not self.outs:
self.ins = True
Expand All @@ -53,6 +55,10 @@ def run(self, args: argparse.Namespace):
command = IngenCommand()
command.run(args)

if not self.task_type.run_outgen():
print(util.warning("Outgen is not supported for this task type."))
return

if self.outs:
command = OutgenCommand()
command.run(args)
4 changes: 4 additions & 0 deletions src/sinol_make/commands/outgen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from sinol_make.structs.gen_structs import OutputGenerationArguments
from sinol_make.helpers import parsers, package_util, cache, paths
from sinol_make.interfaces.BaseCommand import BaseCommand
from sinol_make.task_type import BaseTaskType


class Command(BaseCommand):
Expand Down Expand Up @@ -109,6 +110,9 @@ def run(self, args: argparse.Namespace):

self.args = args
self.task_id = package_util.get_task_id()
self.task_type = BaseTaskType.get_task_type()
if not self.task_type.run_outgen():
util.exit_with_error('Output generation is not supported for this task type.')
package_util.validate_test_names(self.task_id)
util.change_stack_size_to_unlimited()
cache.check_correct_solution(self.task_id)
Expand Down
Loading

0 comments on commit b95c7e2

Please sign in to comment.