コード例 #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
ファイル: __init__.py プロジェクト: d0c-s4vage/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)
コード例 #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
ファイル: __init__.py プロジェクト: CylanceSPEAR/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