Skip to content

Commit

Permalink
Merge pull request #119 from mhearne-usgs/prodfix2
Browse files Browse the repository at this point in the history
Fixed getproduct so that hopefully shortest matching content is deliv…
  • Loading branch information
mhearne-usgs authored Apr 27, 2018
2 parents 83af46d + 003ff1f commit 7b7bcec
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions bin/getproduct
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,8 @@ def _get_product_from_detail(detail, product, contents, folder,
iversion = product.version
prodsource = product.source
for content in contents:
matching_contents = product.getContentsMatching(content)
if not len(matching_contents):
sys.stderr.write('No %s for %s %s product.\n' %
(content, detail.id, product))
continue
content_name = matching_contents[0]
if not list_only:
content_name = product.getContentName(content)
sversion = fmt % iversion
fname = '%s_%s_%s_%s' % (
eventid, prodsource, sversion, content_name)
Expand Down Expand Up @@ -136,7 +131,7 @@ def get_parser():
default='preferred')
parser.add_argument('--get-source', dest='source', default='preferred',
help='Get contents for the "preferred" source, "all" sources, or a specific source ("us").')
parser.add_argument('--host',
parser.add_argument('--host',
help='Specify a different comcat *search* host than earthquake.usgs.gov.')
return parser

Expand Down

0 comments on commit 7b7bcec

Please sign in to comment.