Changeset b10375f
- Timestamp:
- May 25, 2010 9:25:58 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 75720ab
- Parents:
- d38ff56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd_create.py
rd38ff56 rb10375f 2 2 3 3 import sys 4 import re 4 5 5 6 from federation.remote_service import service_caller … … 74 75 75 76 # Main line 77 service_re = re.compile('^\\s*#\\s*SERVICE:\\s*([\\S]+)') 76 78 parser = fedd_create_opts() 77 79 (opts, args) = parser.parse_args() … … 82 84 if opts.file: 83 85 try: 84 exp_desc = "".join([ line for line in open(opts.file, 'r')]) 86 lines = [ line for line in open(opts.file, 'r')] 87 exp_desc = "".join(lines) 85 88 except EnvironmentError: 86 89 sys.exit("Cannot read description file (%s)" %opts.file) … … 95 98 svcs.append(project_export_service(opts.master, opts.project)) 96 99 svcs.extend([ parse_service(s) for s in opts.service]) 100 # Parse all the strings that we can pull out of the file using the service_re. 101 svcs.extend([parse_service(service_re.match(l).group(1)) \ 102 for l in lines if service_re.match(l)]) 103 97 104 if not svcs: 98 105 print >>sys.stderr, "Warning:Neither master/project nor services requested"
Note: See TracChangeset
for help on using the changeset viewer.