Skip to content

Commit

Permalink
No outgen in interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed May 29, 2024
1 parent fbb264e commit cf5482d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 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 get_task_type


class Command(BaseCommand):
Expand Down Expand Up @@ -40,6 +41,7 @@ def configure_subparser(self, subparser):

def run(self, args: argparse.Namespace):
args = util.init_package_command(args)
task_type = get_task_type()

self.args = args
self.ins = args.only_inputs
Expand All @@ -53,6 +55,6 @@ def run(self, args: argparse.Namespace):
command = IngenCommand()
command.run(args)

if self.outs:
if self.outs and task_type.run_outgen():
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 get_task_type


class Command(BaseCommand):
Expand Down Expand Up @@ -106,6 +107,9 @@ def clean_cache(self, inputs):

def run(self, args: argparse.Namespace):
args = util.init_package_command(args)
task_type = get_task_type()
if not task_type.run_outgen():
util.exit_with_error('This task type does not support output generation.')

self.args = args
self.task_id = package_util.get_task_id()
Expand Down
3 changes: 3 additions & 0 deletions src/sinol_make/task_type/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ def __init__(self, task_id):
self.task_id = task_id
self._has_checker = False

def run_outgen(self):
return True

def get_files_to_compile(self) -> List[Tuple[str, List[str], Dict[str, Any]]]:
"""
Returns a list of tuples where:
Expand Down
3 changes: 3 additions & 0 deletions src/sinol_make/task_type/interactive_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def __init__(self, task_id):
self.interactor = None
self.interactor_exe = None

def run_outgen(self):
return False

def get_files_to_compile(self):
super().get_files_to_compile()
interactors = package_util.get_files_matching_pattern(self.task_id, f'{self.task_id}soc.*')
Expand Down

0 comments on commit cf5482d

Please sign in to comment.