2 from SequenceTypes
import *
3 from Modules
import OutputModule, EDProducer, EDFilter, EDAnalyzer
12 if isinstance(visitee,OutputModule):
13 raise ValueError(
"Path "+self.
__label+
"cannot contain an OutputModule, '"+visitee.type_()+
"', with label '"+visitee.label_()+
"'")
14 if hasattr(visitee,
"label_")
and not isinstance(visitee,Sequence):
15 if not visitee.hasLabel_():
16 raise ValueError(
"Path "+self.
__label+
"contains a module of type '"+visitee.type_()+
"' which has no assigned label.\n Most likely the module was never added to the process or it got replaced before being inserted into the process.")
21 _presetFilters = [
"TriggerResultsFilter",
"HLTPrescaler"]
28 if isinstance(visitee,EDFilter):
31 self.filtersOnEndpaths.append(visitee.type_())
32 if hasattr(visitee,
"label_")
and not isinstance(visitee,Sequence):
33 if not visitee.hasLabel_():
34 raise ValueError(
"EndPath "+self.
__label+
"contains a module of type '"+visitee.type_()+
"' which has no assigned label.\n Most likely the module was never added to the process or it got replaced before being inserted into the process.")
38 if __name__==
"__main__":
44 def testValidators(self):
50 producer.setLabel(
"producer")
51 analyzer.setLabel(
"analyzer")
52 output.setLabel(
"output")
53 filter.setLabel(
"filter")
58 p3 =
Path(s1+unlabeled)
59 ep1 =
EndPath(producer+output+analyzer)
65 p1.visit(pathValidator)
66 self.assertRaises(ValueError, p2.visit, pathValidator)
67 self.assertRaises(ValueError, p3.visit, pathValidator)
68 ep1.visit(endpathValidator)
69 ep2.visit(endpathValidator)
70 ep3.visit(endpathValidator)
71 self.assertRaises(ValueError, ep4.visit, endpathValidator)