4 from AnalysisAlgorithmsConfig.ConfigBlock
import ConfigBlock
5 from AnaAlgorithm.DualUseConfig
import isAthena, useComponentAccumulator
7 from pathlib
import Path
10 """ConfigBlock for tool properties printing.
12 This class handles configuration for printing tool properties to a specified
17 super (PrintToolConfigAlgBlock, self).__init__ ()
19 self.addOption(
'OutputFile',
'tool_config.txt', type=str,
20 info=
"Name of the file where the tool configuration will be written.")
21 self.addOption(
'OutputDir',
None, type=str,
22 info=
"Directory where the output file will be written. If 'None',"
23 " the current directory of the job.")
26 """Return the instance name for this block"""
30 """Get the complete output file path.
33 Path object representing the full output file path.
35 output_dir = self.OutputDir
if self.OutputDir
is not None else Path.cwd()
36 return Path(output_dir) / self.OutputFile
39 """Create and configure the PrintToolConfigAlg algorithm.
42 config: Configuration object used to create the algorithm.
44 if isAthena
and useComponentAccumulator:
49 alg = config.createAlgorithm(
'CP::PrintToolConfigAlg',
'PrintToolConfigAlg')