X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=clientbin%2FsfiAddLinks.py;h=f3792b6cc73faf35e48e5f689be6d916faa8724a;hb=8e558be62ca1e048cedb76d6036d1acbfa827bd4;hp=2e667b1bfe204e62269d8fc69c4422a7b73e9aaf;hpb=cedf37c8661ec0b05349274962bf2db9cfa6a24d;p=sfa.git diff --git a/clientbin/sfiAddLinks.py b/clientbin/sfiAddLinks.py index 2e667b1b..f3792b6c 100755 --- a/clientbin/sfiAddLinks.py +++ b/clientbin/sfiAddLinks.py @@ -19,24 +19,25 @@ if not command.opts.linkfile: print "Missing link list -- exiting" command.parser.print_help() sys.exit(1) - + if command.opts.infile: - infile=file(command.opts.infile) + infile = open(command.opts.infile) else: - infile=sys.stdin + infile = sys.stdin if command.opts.outfile: - outfile=file(command.opts.outfile,"w") + outfile = open(command.opts.outfile, "w") else: - outfile=sys.stdout + outfile = sys.stdout ad_rspec = RSpec(infile) -links = file(command.opts.linkfile).read().split('\n') +links = open(command.opts.linkfile).read().split('\n') link_tuples = map(lambda x: tuple(x.split()), links) version_manager = VersionManager() try: type = ad_rspec.version.type version_num = ad_rspec.version.version - request_version = version_manager._get_version(type, version_num, 'request') + request_version = version_manager._get_version( + type, version_num, 'request') request_rspec = RSpec(version=request_version) request_rspec.version.merge(ad_rspec) request_rspec.version.add_link_requests(link_tuples)