26 import optparse
27 parser = optparse.OptionParser(usage='', add_help_option=False)
28
29 parser.add_option('-d', '--db', type='string', action='store', default='TRIGGERDB',
30 help='Trigger DB alias [%default]')
31
32 parser.add_option('-s', '--short', action='store_true',
33 help='Only print property values')
34
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)
38
39 (opts, args) = parser.parse_args()
40
41 if len(args)<3:
42 parser.print_help()
43 return 1
44
45 comp = args[0]
46 prop = args[1]
47 smk = args[2:]
48
49 res = getPropertyFromDB(opts.db, smk, comp, prop)
50 if len(res)==0:
51 print(
'Cannot find property in DB')
52 return 2
53
54
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)
57
58 for p in res:
59 if opts.short:
61 else:
62 print(
'%s %d %s %s %s' % (p[4],p[0],p[1],p[2],p[3]))
63
64
void print(char *figname, TCanvas *c1)