108 athMsgLog.info(
"Hello from the config-checker!")
111 version = h_version[0]
112 subversion = h_version[2]
113 subsubversion = h_version[4]
114 athMsgLog.info(
"The current Herwig version is "+version+
"."+subversion+
"."+subsubversion)
117 files = [f
for f
in os.listdir(
'.')
if os.path.isfile(f)]
121 HerwigINFile.append(file)
124 run_name = HerwigINFile[0]
125 athMsgLog.info(
"The Herwig7 *.in file is "+run_name)
133 f =
open(run_name,
"r")
137 if not line.startswith(
"#"):
138 cd,cd_cmd,set_commands,read_commands,create_commands,insert_commands =
sort_commands(line,
139 cd_in_line,cd_command,set_commands,
140 read_commands,create_commands,insert_commands)
141 cd_in_line,cd_command = cd,cd_cmd
147 create_commands =
clean_string(create_commands,
"create ",
"")
149 read_commands =
clean_string(read_commands,
"snippets/",
"")
152 include_path = os.environ[
'HERWIG7_PATH']+
"/share/Herwig/"
153 snippet_path = os.environ[
'HERWIG7_PATH']+
"/share/Herwig/snippets/"
155 include_files = [f
for f
in os.listdir(include_path)]
156 snippet_files = [f
for f
in os.listdir(snippet_path)]
160 for file
in include_files:
161 for command
in read_commands:
163 read_files.append(include_path+file)
164 for file
in snippet_files:
165 for command
in read_commands:
167 read_files.append(snippet_path+file)
170 for file
in read_files:
171 if ".in" not in file:
172 athMsgLog.info(
"Skipping file " + file +
" since it does not contain any in-file")
173 athMsgLog.info(
"It is just a directory, can be ignored.")
180 if not line.startswith(
"#"):
181 cd,cd_cmd,set_commands,read_commands,create_commands,insert_commands =
sort_commands(line,cd_in_line,cd_command,set_commands,read_commands,create_commands,insert_commands)
182 cd_in_line,cd_command = cd,cd_cmd
189 create_commands =
clean_string(create_commands,
"create ",
"")
191 read_commands =
clean_string(read_commands,
"snippets/",
"")
199 athMsgLog.info(
"\n These are the commands found by the Herwig7JOChecker:\n")
213 with open(
"HerwigCommandDuplicates.txt",
"w")
as file:
221 with open(
"HerwigCommands.txt",
"w")
as file:
227 if found_duplicate1
or found_duplicate2
or found_duplicate3:
228 athMsgLog.warn(
"There were some settings which are overwritten, please check the log-file HerwigCommandDuplicates.txt")
231 athMsgLog.info(
"Godybe from the config-checker!")