示例#1
0
    def __init__(self, config, name):
        # Determine ROOT path from previous settings / environment / config file
        self._rootpath = config.get('root path',
                                    os.environ.get('ROOTSYS', ''),
                                    persistent=True,
                                    onChange=changeInitNeeded('sandbox'))
        if not self._rootpath:
            raise ConfigError(
                'Either set environment variable "ROOTSYS" or set option "root path"!'
            )
        utils.vprint('Using the following ROOT path: %s' % self._rootpath, -1)

        # Special handling for executables bundled with ROOT
        self._executable = config.get('executable',
                                      onChange=changeInitNeeded('sandbox'))
        exeFull = os.path.join(self._rootpath, 'bin',
                               self._executable.lstrip('/'))
        self.builtIn = os.path.exists(exeFull)
        if self.builtIn:
            config.set('send executable', 'False')
            # store resolved built-in executable path?

        # Apply default handling from UserTask
        UserTask.__init__(self, config, name)
        self.updateErrorDict(utils.pathShare('gc-run.root.sh'))

        # Collect lib files needed by executable
        self.libFiles = []
示例#2
0
    def __init__(self, config, name):
        # Determine ROOT path from previous settings / environment / config file
        def _check_root_dn(loc, obj):
            if os.path.isdir(obj):
                return obj
            raise ConfigError(
                'Either set environment variable "ROOTSYS" or set option "root path"!'
            )

        self._root_dn = config.get_dn('root path',
                                      os.environ.get('ROOTSYS', ''),
                                      persistent=True,
                                      on_change=TriggerInit('sandbox'),
                                      on_valid=_check_root_dn)
        logging.getLogger('task').info('Using the following ROOT path: %s',
                                       self._root_dn)

        # Special handling for executables bundled with ROOT
        self._executable = config.get('executable',
                                      on_change=TriggerInit('sandbox'))
        exe_full = os.path.join(self._root_dn, 'bin',
                                self._executable.lstrip('/'))
        self._is_builtin = os.path.exists(exe_full)
        if self._is_builtin:
            config.set('send executable', 'False')
            # store resolved built-in executable path?

        # Apply default handling from UserTask
        UserTask.__init__(self, config, name)
        self._update_map_error_code2msg(get_path_share('gc-run.root.sh'))

        # TODO: Collect lib files needed by executable
        self._lib_fn_list = []
示例#3
0
	def __init__(self, config, name):
		# Determine ROOT path from previous settings / environment / config file
		self._rootpath = config.get('root path', os.environ.get('ROOTSYS', ''), persistent = True, onChange = changeInitNeeded('sandbox'))
		if not self._rootpath:
			raise ConfigError('Either set environment variable "ROOTSYS" or set option "root path"!')
		utils.vprint('Using the following ROOT path: %s' % self._rootpath, -1)

		# Special handling for executables bundled with ROOT
		self._executable = config.get('executable', onChange = changeInitNeeded('sandbox'))
		exeFull = os.path.join(self._rootpath, 'bin', self._executable.lstrip('/'))
		self.builtIn = os.path.exists(exeFull)
		if self.builtIn:
			config.set('send executable', 'False')
			# store resolved built-in executable path?

		# Apply default handling from UserTask
		UserTask.__init__(self, config, name)
		self.updateErrorDict(utils.pathShare('gc-run.root.sh'))

		# Collect lib files needed by executable
		self.libFiles = []
示例#4
0
	def __init__(self, config, name):
		# Determine ROOT path from previous settings / environment / config file
		def _check_root_dn(loc, obj):
			if os.path.isdir(obj):
				return obj
			raise ConfigError('Either set environment variable "ROOTSYS" or set option "root path"!')
		self._root_dn = config.get_dn('root path', os.environ.get('ROOTSYS', ''),
			persistent=True, on_change=TriggerInit('sandbox'), on_valid=_check_root_dn)
		logging.getLogger('task').info('Using the following ROOT path: %s', self._root_dn)

		# Special handling for executables bundled with ROOT
		self._executable = config.get('executable', on_change=TriggerInit('sandbox'))
		exe_full = os.path.join(self._root_dn, 'bin', self._executable.lstrip('/'))
		self._is_builtin = os.path.exists(exe_full)
		if self._is_builtin:
			config.set('send executable', 'False')
			# store resolved built-in executable path?

		# Apply default handling from UserTask
		UserTask.__init__(self, config, name)
		self._update_map_error_code2msg(get_path_share('gc-run.root.sh'))

		# TODO: Collect lib files needed by executable
		self._lib_fn_list = []
示例#5
0
	def get_task_dict(self):
		return dict_union(UserTask.get_task_dict(self), {'GC_ROOTSYS': self._root_dn})
示例#6
0
	def get_sb_in_fpi_list(self):
		return UserTask.get_sb_in_fpi_list(self) + self._lib_fn_list + [
			Result(path_abs=get_path_share('gc-run.root.sh'), path_rel='gc-run.root.sh')]
示例#7
0
	def getSBInFiles(self):
		return UserTask.getSBInFiles(self) + self.libFiles + [
			utils.Result(pathAbs = utils.pathShare('gc-run.root.sh'), pathRel = 'gc-run.root.sh')]
示例#8
0
	def getTaskConfig(self):
		return utils.mergeDicts([UserTask.getTaskConfig(self), {'GC_ROOTSYS': self._rootpath}])
示例#9
0
 def getSBInFiles(self):
     return UserTask.getSBInFiles(self) + self.libFiles + [
         utils.Result(pathAbs=utils.pathShare('gc-run.root.sh'),
                      pathRel='gc-run.root.sh')
     ]
示例#10
0
 def getTaskConfig(self):
     return utils.mergeDicts(
         [UserTask.getTaskConfig(self), {
             'GC_ROOTSYS': self._rootpath
         }])
示例#11
0
	def get_task_dict(self):
		return dict_union(UserTask.get_task_dict(self), {'GC_ROOTSYS': self._root_dn})
示例#12
0
	def get_sb_in_fpi_list(self):
		return UserTask.get_sb_in_fpi_list(self) + self._lib_fn_list + [
			Result(path_abs=get_path_share('gc-run.root.sh'), path_rel='gc-run.root.sh')]