16 import SerialSubstitution
17 from SerialSubstitution
import AddProcessor, RunSubstitutor
25 'TriggerDataObjects': {
26 'source':
'icaruscode/PMT/Trigger/Data',
27 'dest':
'sbnobj/ICARUS/PMT/Trigger/Data',
33 'source':
'sbndcode/CRT/CRTProducts',
34 'dest':
'sbnobj/SBND/CRT',
35 'headers': [
'CRTData.hh', ],
36 'namespaces': [ (
'crt',
'sbnd::crt', (
'CRTData', ) ), ],
42 'CommonCRTObjectsForSBND': {
43 'source':
'sbndcode/CRT/CRTProducts',
44 'dest':
'sbnobj/Common/CRT',
45 'headers': [
'CRTHit.hh',
'CRTTrack.hh',
'CRTTzero.hh', ],
47 (
'crt',
'sbn::crt', (
'CRTHit',
'CRTTrack',
'CRTTzero', ) ),
48 (
'sbnd::crt',
'sbn::crt', (
'CRTHit',
'CRTTrack',
'CRTTzero', ) ),
55 'source':
'icaruscode/CRT/CRTProducts',
56 'dest':
'sbnobj/ICARUS/CRT',
57 'headers': [
'CRTData.hh', ],
63 'CommonCRTObjectsForICARUS': {
64 'source':
'icaruscode/CRT/CRTProducts',
65 'dest':
'sbnobj/Common/CRT',
66 'headers': [
'CRTHit.hh',
'CRTTrack.hh',
'CRTTzero.hh', ],
68 (
'icarus::crt',
'sbn::crt', (
'CRTHit',
'CRTTrack',
'CRTTzero', ) ),
74 'ICARUSPurityObjects': {
75 'source':
'icaruscode/IcarusObj',
76 'dest':
'sbnobj/Common/Analysis',
90 if __name__ ==
"__main__":
98 Subst.AddFileType(
"fcl")
100 for rule
in Substitutions.values():
106 plugins = rule.get(
'plugins', [
None, ])
108 baseSrc = rule[
'source']
109 baseDest = rule[
'dest']
111 for plugin
in plugins:
112 Subst.AddSimplePattern(
113 baseSrc +
"_" + plugin
if plugin
else baseSrc,
114 baseDest +
"_" + plugin
if plugin
else baseDest,
126 Subst.AddFileNamePattern(
"CMakeLists.txt")
129 for rule
in Substitutions.values():
135 if 'plugins' in rule:
140 for plugin
in rule[
'plugins']:
141 Subst.AddSimplePattern(
142 baseSrc +
"_" + plugin
if plugin
else baseSrc,
143 baseDest +
"_" + plugin
if plugin
else baseDest,
148 Subst.AddSimplePattern(
157 Subst.AddWord(
"sbndcode_CRTProducts",
"sbnobj_Common_CRT")
158 Subst.AddWord(
"icaruscode_CRTProducts",
"sbnobj_Common_CRT")
166 Subst.AddFileType(
"h",
"hh",
"cc",
"cpp",
"cxx",
"icc",
"tcc" )
168 for rule
in Substitutions.values():
170 headers = rule.get(
'headers', [
'' ])
172 for header
in headers:
174 baseSrc = os.path.join(rule[
'source'], header)
175 baseDest = os.path.join(rule[
'dest'], header)
179 (Subst.AddWord
if header
else Subst.AddSimplePattern)(
187 Subst.AddSimplePattern(
194 for nsSpec
in rule.get(
'namespaces', []):
196 try: (srcNS, destNS), classes = nsSpec, [
None, ]
197 except ValueError: srcNS, destNS, classes = nsSpec
199 for className
in classes:
200 srcClass =
"::".
join((srcNS, className))
if className
else (srcNS +
"::")
201 destClass =
"::".
join((destNS, className))
if className
else (destNS +
"::")
202 Subst.AddRegExPattern(
r'([^:]|^)\b{}\b'.
format(srcClass),
r'\1{}'.
format(destClass))
static std::string format(PyObject *obj, unsigned int pos, unsigned int indent, unsigned int maxlen, unsigned int depth)
def intoHeaderGuardPrefix
S join(S const &sep, Coll const &s)
Returns a concatenation of strings in s separated by sep.