ATLAS Offline Software
Loading...
Searching...
No Matches
generateReferenceFile.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3#
4# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5#
6
7import re
8import glob
9import json
10
11functionDict = {}
12files = glob.glob('**/*onfig.py', recursive=True)
13files = files + glob.glob('**/*onfigNew.py', recursive=True)
14for file in files:
15 for line in open(file, 'r', encoding="utf-8"):
16 match = re.search(r"CompFactory\.(\w+\.?\w+) ?\‍(", line)
17 if match:
18 fun = match.group(1)
19 if fun in functionDict:
20 functionDict[fun].add(file)
21 else:
22 functionDict[fun] = {file}
23
24duplicates = {}
25for item in functionDict.items():
26 if len(item[1]) > 1:
27 duplicates[item[0]]=list(item[1])
28
29with open("referenceDuplicates.txt", "w") as f:
30 f.write(json.dumps(duplicates))
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55