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 """Get the complete output file path.
29 Path object representing the full output file path.
31 output_dir = self.OutputDir
if self.OutputDir
is not None else Path.cwd()
32 return Path(output_dir) / self.OutputFile
35 """Create and configure the PrintToolConfigAlg algorithm.
38 config: Configuration object used to create the algorithm.
40 if isAthena
and useComponentAccumulator:
45 alg = config.createAlgorithm(
'CP::PrintToolConfigAlg',
'PrintToolConfigAlg')