version-1.30
Last change
on this file since 4adc697 was
5d3f239,
checked in by Ted Faber <faber@…>, 16 years ago
|
change package name to avoid conflicts with fedd on install
|
-
Property mode set to
100755
|
File size:
625 bytes
|
Line | |
---|
1 | #!/usr/local/bin/python |
---|
2 | |
---|
3 | from federation import fedid |
---|
4 | from optparse import OptionParser |
---|
5 | |
---|
6 | |
---|
7 | class fedid_opts(OptionParser): |
---|
8 | """Encapsulate option processing in this class, rather than in main""" |
---|
9 | def __init__(self): |
---|
10 | OptionParser.__init__(self, usage="%prog [opts] (--help for details)", |
---|
11 | version="1.0") |
---|
12 | |
---|
13 | self.add_option("-a", "--attribute", action="append", dest="attrs", |
---|
14 | help="Append attribute to each fedid") |
---|
15 | |
---|
16 | parser = fedid_opts() |
---|
17 | opts, args = parser.parse_args() |
---|
18 | |
---|
19 | for arg in args: |
---|
20 | fid = fedid(file=arg) |
---|
21 | if opts.attrs: print "fedid:%s %s" % (fid, ','.join(opts.attrs)) |
---|
22 | else: print "fedid:%s" % fid |
---|
23 | |
---|
Note: See
TracBrowser
for help on using the repository browser.