Example #1
0
class RunDefBus(object):
    def __init__(self):

        object.__init__(self)

        self.__logger = OrcLog("api.run.bus.run_def")
        self.__model_run_def = RunDefMod()

    def bus_list_add(self, p_data):
        """
        新增
        :param p_data:
        :return:
        """
        try:
            result = self.__model_run_def.usr_add(p_data)
        except Exception:
            self.__logger.error("Add run error, input: %s" % p_data)
            raise OrcApiModelFailException

        self.__logger.debug("function %s return %s" % ("bus_list_add", result))

        return result

    def bus_list_delete(self, p_list):
        """
        删除
        :param p_list:
        :return:
        """
        try:
            self.__model_run_def.usr_delete(p_list)
        except Exception:
            self.__logger.error("Add batch error, input: %s" % p_list)
            raise OrcApiModelFailException

        return True

    def bus_list_search(self, p_cond):
        """
        查询
        :param p_cond:
        :return:
        """
        try:
            result = self.__model_run_def.usr_search(p_cond)
        except Exception:
            self.__logger.error("Add batch error, input: %s" % p_cond)
            raise OrcApiModelFailException

        return result
Example #2
0
    def test_log_api(self):
        """
        Test get exist option
        """
        OrcTest.test_print_begin()

        init_log()

        _log = OrcLog("api.test01")

        _log.info("This 001!")
        _log.warning("This 002!")
        _log.error("This 003!")
        _log.critical("This 004!")
        _log.debug("This 005!")

        OrcTest.test_print_end()