How to use the cliboa.util.lisboa_log.LisboaLog 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_base.py View on Github external
def test_logging_mask(self):
        instance = SampleStep()
        instance.logger = LisboaLog.get_logger(__name__)
        setattr(instance, "user", "admin")
        setattr(instance, "password", "test")
        instance.trigger()
        ret = False
        with open(self._log_file, mode="r", encoding="utf-8") as f:
            for line in f:
                if "password : ****" in line:
                    ret = True
                    break
        assert ret is True
github BrainPad / cliboa / tests / scenario / transform / test_file.py View on Github external
instance = FileConvert()
            Helper.set_property(instance, "logger", LisboaLog.get_logger(__name__))
            Helper.set_property(instance, "src_dir", self._data_dir)
            Helper.set_property(instance, "src_pattern", r"test\.txt")
            Helper.set_property(instance, "encoding_from", "utf-8")
            Helper.set_property(instance, "encoding_to", "utf-16")
            instance.execute()

            with open(test_file, errors="ignore") as t:
                str_utf16 = t.read()

            assert str_utf16 != STR_UTF8

            # set the essential attributes
            instance = FileConvert()
            Helper.set_property(instance, "logger", LisboaLog.get_logger(__name__))
            Helper.set_property(instance, "src_dir", self._data_dir)
            Helper.set_property(instance, "src_pattern", r"test\.txt")
            Helper.set_property(instance, "encoding_from", "utf-16")
            Helper.set_property(instance, "encoding_to", "utf-8")
            instance.execute()

            with open(test_file) as t:
                str_utf8 = t.read()

            assert str_utf8 == STR_UTF8

        finally:
            shutil.rmtree(self._data_dir)
github BrainPad / cliboa / cliboa / util / string.py View on Github external
def __init__(self):
        self._logger = LisboaLog.get_logger(__name__)
github BrainPad / cliboa / cliboa / util / ftp_util.py View on Github external
user (str): username
            password (str): password
            timeout=30 (int): timeout seconds
            retryTimes=3 (int): retry count
            port=21 (int): port number
            tls=False (bool): use secure connection
        """

        self.__host = host
        self.__user = user
        self.__password = password
        self.__timeout = timeout
        self.__retryTimes = retryTimes
        self.__port = port
        self.__tls = tls
        self._logger = LisboaLog.get_logger(__name__)
github BrainPad / cliboa / cliboa / core / strategy.py View on Github external
def __init__(self, obj):
        """
        Args:
            q: queue which stores execution target steps
            cmd_args: command line arguments
        """
        self._logger = LisboaLog.get_logger(__name__)
        self._step = obj

        # enable to regist multiple listeners
        self._listeners = []
github BrainPad / cliboa / cliboa / core / file_parser.py View on Github external
def __init__(self, pj_scenario_file, cmn_scenario_file):
        self._logger = LisboaLog.get_logger(__name__)
        self._pj_scenario_file = pj_scenario_file
        self._cmn_scenario_file = cmn_scenario_file
github BrainPad / cliboa / cliboa / util / sqlite.py View on Github external
def __init__(self):
        self._logger = LisboaLog.get_logger(__name__)
        self.__cur = None
        self.__con = None
github BrainPad / cliboa / cliboa / scenario / validator.py View on Github external
def __init__(self, dbname, tblname, returns_bool=False):
        """
        Args:
            dbname: database name
            tblname: table name
            returns_bool: return bool or not
        """
        self.__sqlite_adptr = SqliteAdapter()
        self.__dbname = dbname
        self.__tblname = tblname
        self.__returns_bool = returns_bool
        self._logger = LisboaLog.get_logger(__name__)
github BrainPad / cliboa / cliboa / scenario / sample_step.py View on Github external
def __init__(self):
        super().__init__()
        self._retry_count = 3
        self._logger = LisboaLog.get_logger(__name__)