4 """Usage: trigconf_property.py [Options] COMPONENT PROPERTY SMK [SMK2 ...]')
6 Read trigger configuration properties from DB. SQL wildcards ('%') can be used to
7 print all matching components/properties.
9 Example: trigconf_property.py Trig% OutputLevel 1178
12 __author__ =
"Frank Winklmeier"
15 from TrigConfigSvc.TrigConfigSvcUtils
import getPropertyFromDB
17 def myhelp(option, opt_str, value, parser):
18 """Custom help callback since optparse does not preserve newlines"""
27 parser = optparse.OptionParser(usage=
'', add_help_option=
False)
29 parser.add_option(
'-d',
'--db', type=
'string', action=
'store', default=
'TRIGGERDB',
30 help=
'Trigger DB alias [%default]')
32 parser.add_option(
'-s',
'--short', action=
'store_true',
33 help=
'Only print property values')
35 parser.add_option(
'--l2', action=
'store_true', help=
'Only show L2')
36 parser.add_option(
'--ef', action=
'store_true', help=
'Only show EF')
37 parser.add_option(
"-h",
"--help", action=
"callback", callback=myhelp)
39 (opts, args) = parser.parse_args()
51 print(
'Cannot find property in DB')
55 if opts.l2
is True and not opts.ef: res =
filter(
lambda x: x[4]==
'L2',res)
56 if opts.ef
is True and not opts.l2: res =
filter(
lambda x: x[4]==
'EF',res)
62 print(
'%s %d %s %s %s' % (p[4],p[0],p[1],p[2],p[3]))
65 if __name__ ==
'__main__':
68 except KeyboardInterrupt: