def __init__(self, app_namespace, input_name): super(BaseModInput, self).__init__() self._canceled = False self.input_name = None self.input_stanzas = {} self.context_meta = {} self.namespace = app_namespace # redirect all the logging to one file Logs.set_context(namespace=app_namespace, root_logger_log_file=input_name) self.logger = logging.getLogger() self.logger.setLevel(logging.INFO) self.http_session = None self.requests_proxy = None # check point self.ckpt = None # try to load the setup util module self.setup_util_module = None self.setup_util = None try: self.setup_util_module = importlib.import_module(self.namespace + "_setup_util") except ImportError as ie: # Commented this out to reduce noise in ModInput log # self.logger.info("Can not import package:" + # self.namespace + "_setup_util") pass
def __init__(self, app_namespace, input_name, use_single_instance=False): super().__init__() self.use_single_instance = use_single_instance self._canceled = False self.input_type = input_name self.input_stanzas = {} self.context_meta = {} self.namespace = app_namespace # redirect all the logging to one file Logs.set_context(namespace=app_namespace, root_logger_log_file=input_name) self.logger = logging.getLogger() self.logger.setLevel(logging.INFO) self.rest_helper = TARestHelper(self.logger) # check point self.ckpt = None self.setup_util = None