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]))