9 from AthenaCommon.Logging
import logging
10 log = logging.getLogger(__name__)
14 Repository of all configured chains. Contains chain dictionaries and Menu Chain objects.
20 """Register chain for future use"""
21 chainName = chainDict[
'chainName']
22 assert chainName
not in cls.
__allChainDicts, f
'Chain dictionary {chainName} already registered'
25 log.debug(
"Registered chain %s", chainName)
29 """Release memory and make the class unusable"""
49 if __name__ ==
"__main__":
50 log.info(
'Self testing')
52 HLTMenuConfig.registerChain({
'chainName':
'HLT_bla1'})
53 HLTMenuConfig.registerChain({
'chainName':
'HLT_bla2'})
55 HLTMenuConfig.registerChain({
'chainName':
'HLT_bla2'})
56 except AssertionError:
57 log.info(
"ok, cannot register same chain twice")
59 log.error(
"registered same chain twice")
61 HLTMenuConfig.getChainDictFromChainName(
'HLT_bla1')
62 HLTMenuConfig.getChainDictFromChainName(
'HLT_bla2')
64 log.info(
"ok, registration works")
66 HLTMenuConfig.getChainDictFromChainName(
'HLT_blabla')
67 except Exception
as e:
68 if isinstance(e, KeyError):
69 log.info(
"ok, unregistered chain handling works")
71 log.error(
"unhandled missing chain")