diff --git a/acclimatise/converter/__init__.py b/acclimatise/converter/__init__.py index 30aac1b..9666a13 100644 --- a/acclimatise/converter/__init__.py +++ b/acclimatise/converter/__init__.py @@ -49,6 +49,16 @@ def choose_converter(cls, typ) -> Type["WrapperGenerator"]: raise Exception("Unknown format type") + @classmethod + @abstractmethod + def validate(cls, wrapper: str, cmd: Command = None, explore=True): + """ + Validates that the tool wrapper is correct, and that it correctly represents the command. + :param wrapper: The generated tool definition + :param cmd: The command to validate against + :param explore: If true, we're in explore mode, and we should ignore subcommands + """ + @classmethod @abstractmethod def format(cls) -> str: diff --git a/acclimatise/converter/galaxy.py b/acclimatise/converter/galaxy.py new file mode 100644 index 0000000..ae09127 --- /dev/null +++ b/acclimatise/converter/galaxy.py @@ -0,0 +1,38 @@ +import inspect +import tempfile +from io import IOBase, StringIO, TextIOBase +from os import PathLike +from pathlib import Path +from typing import Generator, List + +from dataclasses import dataclass + +from acclimatise import cli_types +from acclimatise.converter import NamedArgument, WrapperGenerator +from acclimatise.model import CliArgument, Command, Flag, Positional +from acclimatise.yaml import yaml + + +@dataclass +class GalaxyGenerator(WrapperGenerator): + case = "snake" + + @classmethod + def format(cls) -> str: + return "galaxy" + + @property + def suffix(self) -> str: + return ".xml" + + def save_to_string(self, cmd: Command) -> str: + # Todo + pass + + def save_to_file(self, cmd: Command, path: Path) -> None: + # Todo + pass + + @classmethod + def validate(cls, wrapper: str, cmd: Command = None, explore=True): + pass