Skip to content

Commit 7b7bcec

Browse files
author
Mike Hearne
authored
Merge pull request #119 from mhearne-usgs/prodfix2
Fixed getproduct so that hopefully shortest matching content is deliv…
2 parents 83af46d + 003ff1f commit 7b7bcec

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

bin/getproduct

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,8 @@ def _get_product_from_detail(detail, product, contents, folder,
4646
iversion = product.version
4747
prodsource = product.source
4848
for content in contents:
49-
matching_contents = product.getContentsMatching(content)
50-
if not len(matching_contents):
51-
sys.stderr.write('No %s for %s %s product.\n' %
52-
(content, detail.id, product))
53-
continue
54-
content_name = matching_contents[0]
5549
if not list_only:
50+
content_name = product.getContentName(content)
5651
sversion = fmt % iversion
5752
fname = '%s_%s_%s_%s' % (
5853
eventid, prodsource, sversion, content_name)
@@ -136,7 +131,7 @@ def get_parser():
136131
default='preferred')
137132
parser.add_argument('--get-source', dest='source', default='preferred',
138133
help='Get contents for the "preferred" source, "all" sources, or a specific source ("us").')
139-
parser.add_argument('--host',
134+
parser.add_argument('--host',
140135
help='Specify a different comcat *search* host than earthquake.usgs.gov.')
141136
return parser
142137

0 commit comments

Comments
 (0)