예제 #1
0
파일: __init__.py 프로젝트: optiv/talus
    def __init__(self,
                 idx=None,
                 progress_cb=None,
                 results_cb=None,
                 parent_log=None,
                 **kwargs):
        """TODO: to be defined1. """
        self.idx = idx
        if parent_log is not None:
            # TODO maybe we should explicitly set a flag that says it's being run
            # with the bootstrap... talus.BOOTSTRAP_RUNNING = True?? dunno
            TalusCodeBase.__init__(self, **kwargs)
            self.log = parent_log.getChild(self.__class__.__name__)

        else:
            TalusCodeBase.__init__(self)
            self.log = logging.getLogger("RUNLOCAL").getChild(
                self.__class__.__name__)

            self._total_progress = 0
            self._file_counter = 0
            self._results_dir = os.path.join(os.getcwd(), "TALUS_RESULTS")
            if not os.path.exists(self._results_dir):
                os.makedirs(self._results_dir)

        if len(self.log.handlers) == 0:
            logging.basicConfig(level=logging.DEBUG)

        self._progress_cb = progress_cb
        self._results_cb = results_cb
예제 #2
0
    def __init__(self, parent_log=None, **kwargs):
        """Initialize the component """
        if parent_log is not None:
            TalusCodeBase.__init__(self, **kwargs)
            self.log = parent_log.getChild(self.__class__.__name__)

        else:
            TalusCodeBase.__init__(self)
            self.log = logging.getLogger("RUNLOCAL").getChild(self.__class__.__name__)
            # everything else at this point should be the normal args, so init them
            self.init(**kwargs)

        if len(self.log.handlers) == 0:
            logging.basicConfig(level=logging.DEBUG)
예제 #3
0
파일: __init__.py 프로젝트: asdyxcyxc/talus
    def __init__(self, parent_log=None, **kwargs):
        """Initialize the component """
        if parent_log is not None:
            TalusCodeBase.__init__(self, **kwargs)
            self.log = parent_log.getChild(self.__class__.__name__)

        else:
            TalusCodeBase.__init__(self)
            self.log = logging.getLogger("RUNLOCAL").getChild(
                self.__class__.__name__)
            # everything else at this point should be the normal args, so init them
            self.init(**kwargs)

        if len(self.log.handlers) == 0:
            logging.basicConfig(level=logging.DEBUG)
예제 #4
0
	def __init__(self, idx=None, progress_cb=None, results_cb=None, parent_log=None, **kwargs):
		"""TODO: to be defined1. """
		self.idx = idx
		if parent_log is not None:
			# TODO maybe we should explicitly set a flag that says it's being run
			# with the bootstrap... talus.BOOTSTRAP_RUNNING = True?? dunno
			TalusCodeBase.__init__(self, **kwargs)
			self.log = parent_log.getChild(self.__class__.__name__)

		else:
			TalusCodeBase.__init__(self)
			self.log = logging.getLogger("RUNLOCAL").getChild(self.__class__.__name__)

			self._total_progress = 0
			self._file_counter = 0
			self._results_dir = os.path.join(os.getcwd(), "TALUS_RESULTS")
			if not os.path.exists(self._results_dir):
				os.makedirs(self._results_dir)

		if len(self.log.handlers) == 0:
			logging.basicConfig(level=logging.DEBUG)

		self._progress_cb = progress_cb
		self._results_cb = results_cb