How to use the cliboa.util.exception.CliboaException function in cliboa

To help you get started, we’ve selected a few cliboa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrainPad / cliboa / tests / scenario / test_validator.py View on Github external
def test_essential_parameters_ng(self):
        """
        EssentialParameters invalid case
        """
        with pytest.raises(CliboaException) as excinfo:
            valid = EssentialParameters("DummyClass", [""])
            valid()
        assert "is not specified" in str(excinfo.value)
github BrainPad / cliboa / cliboa / scenario / transform / file.py View on Github external
def _csv_quote(self):
        if "QUOTE_ALL" == self._quote:
            return csv.QUOTE_ALL
        elif "QUOTE_MINIMAL" == self._quote:
            return csv.QUOTE_MINIMAL
        elif "QUOTE_NONNUMERIC" == self._quote:
            return csv.QUOTE_NONNUMERIC
        elif "QUOTE_NONE" == self._quote:
            return csv.QUOTE_NONE
        else:
            raise CliboaException(
                "Unknown quote. One of the followings are allowd [QUOTE_ALL, QUOTE_MINIMAL, QUOTE_NONNUMERIC, QUOTE_NONE]"
            )
github BrainPad / cliboa / cliboa / scenario / transform / file.py View on Github external
def _csv_delimiter(self, ext):
        if ext.upper() == "CSV":
            return ","
        elif ext.upper() == "TSV":
            return "\t"
        else:
            raise CliboaException(
                "Unknown ext. One of the followings are allowd [CSV, TSV]"
            )
github BrainPad / cliboa / cliboa / util / exception.py View on Github external
class FileNotFound(CliboaException):
    # Exception when specified file not found
    pass


class InvalidFileCount(CliboaException):
    # Exception when many files exist more than expacted
    pass


class InvalidParameter(CliboaException):
    # Exception when parameters are invalid
    pass


class InvalidCount(CliboaException):
    # Exception when invalid count was specified
    pass


class InvalidFormat(CliboaException):
    # Exception when invalid format was specified
    pass


class ScenarioFileInvalid(CliboaException):
    # Exception when scenario.yml(json) is invalid
    pass


class StepExecutionFailed(CliboaException):
    # Exception when step execution was failed
github BrainPad / cliboa / cliboa / scenario / extract / file.py View on Github external
def execute(self, *args):
        input_valid = IOInput(self._io)
        input_valid()

        files = glob(self._src_path)
        if len(files) > 1:
            raise CliboaException("Input file must be only one.")

        if len(files) == 0:
            raise FileNotFound("The specified csv file not found.")

        with open(files[0], "r", encoding=self._encoding) as f:

            # save per one column
            if self._columns:
                reader = csv.DictReader(f, delimiter=",")
                for row in reader:
                    # extract only the specified columns
                    row_dict = {}
                    for c in self._columns:
                        if not row.get(c):
                            continue
                        row_dict[c] = row.get(c)
github BrainPad / cliboa / cliboa / util / exception.py View on Github external
class InvalidCount(CliboaException):
    # Exception when invalid count was specified
    pass


class InvalidFormat(CliboaException):
    # Exception when invalid format was specified
    pass


class ScenarioFileInvalid(CliboaException):
    # Exception when scenario.yml(json) is invalid
    pass


class StepExecutionFailed(CliboaException):
    # Exception when step execution was failed
    pass


class SqliteInvalid(CliboaException):
    # Exception when specified file not found
    pass
github BrainPad / cliboa / cliboa / util / exception.py View on Github external
class InvalidFileCount(CliboaException):
    # Exception when many files exist more than expacted
    pass


class InvalidParameter(CliboaException):
    # Exception when parameters are invalid
    pass


class InvalidCount(CliboaException):
    # Exception when invalid count was specified
    pass


class InvalidFormat(CliboaException):
    # Exception when invalid format was specified
    pass


class ScenarioFileInvalid(CliboaException):
    # Exception when scenario.yml(json) is invalid
    pass


class StepExecutionFailed(CliboaException):
    # Exception when step execution was failed
    pass


class SqliteInvalid(CliboaException):
    # Exception when specified file not found
github BrainPad / cliboa / cliboa / util / exception.py View on Github external
class CliboaException(Exception):
    # cliboa unique exception
    pass


class DirStructureInvalid(CliboaException):
    # Exception when directory structure invalid
    pass


class FileNotFound(CliboaException):
    # Exception when specified file not found
    pass


class InvalidFileCount(CliboaException):
    # Exception when many files exist more than expacted
    pass


class InvalidParameter(CliboaException):
    # Exception when parameters are invalid
    pass


class InvalidCount(CliboaException):
    # Exception when invalid count was specified
    pass


class InvalidFormat(CliboaException):
    # Exception when invalid format was specified
github BrainPad / cliboa / cliboa / util / exception.py View on Github external
class DirStructureInvalid(CliboaException):
    # Exception when directory structure invalid
    pass


class FileNotFound(CliboaException):
    # Exception when specified file not found
    pass


class InvalidFileCount(CliboaException):
    # Exception when many files exist more than expacted
    pass


class InvalidParameter(CliboaException):
    # Exception when parameters are invalid
    pass


class InvalidCount(CliboaException):
    # Exception when invalid count was specified
    pass


class InvalidFormat(CliboaException):
    # Exception when invalid format was specified
    pass


class ScenarioFileInvalid(CliboaException):
    # Exception when scenario.yml(json) is invalid