Skip to content

Commit

Permalink
i.sentinel.coverage: Exit with correct message if no products are fou…
Browse files Browse the repository at this point in the history
…nd (#483)

* correct no_product_found message

* Update grass7/imagery/i.sentinel/i.sentinel.coverage/i.sentinel.coverage.py

Co-authored-by: Markus Neteler <neteler@osgeo.org>

Co-authored-by: Markus Neteler <neteler@osgeo.org>
  • Loading branch information
griembauer and neteler committed Mar 18, 2021
1 parent b4320c0 commit ad8533d
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -248,14 +248,14 @@ def main():
if resp[0] != b'':
s_list = resp[0].decode('utf-8').strip().splitlines()
else:
error_msg = ""
for i in range(0, len(resp)):
error_msg += resp[i].decode('utf-8')
grass.fatal(
_("Error using i.sentinel.download: {}").format(error_msg))

if len(s_list) == 0:
grass.fatal('No products found')
if set(resp) == {b''}:
grass.fatal(_("No products found"))
else:
error_msg = ""
for i in range(0, len(resp)):
error_msg += resp[i].decode('utf-8')
grass.fatal(
_("Error using i.sentinel.download: {}").format(error_msg))
name_list_tmp = [x.split(' ')[1] for x in s_list]
else:
name_list_tmp = options['names'].split(',')
Expand Down

0 comments on commit ad8533d

Please sign in to comment.