Skip to content

Commit

Permalink
fix i.modis.import on Windows (parameter input) (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
landam committed May 31, 2020
1 parent 9b19c9c commit 6dbef44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions grass7/imagery/i.modis/i.modis.import/i.modis.import.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def single(options, remove, an, ow, fil):
else:
projwkt = get_proj('w')
projObj = projection()
pref = i.split('/')[-1]
pref = i.split(os.path.sep)[-1]
prod = product().fromcode(pref.split('.')[0])
spectr = spectral(options, prod, an)
if projObj.returned() != 'GEO':
Expand Down Expand Up @@ -410,7 +410,7 @@ def mosaic(options, remove, an, ow, fil):
pid = str(os.getpid())
# for each day
for dat, listfiles in dictfile.items():
pref = listfiles[0].split('/')[-1]
pref = listfiles[0].split(os.path.sep)[-1]
prod = product().fromcode(pref.split('.')[0])
spectr = spectral(options, prod, an)
spectr = spectr.lstrip('( ').rstrip(' )')
Expand Down
8 changes: 4 additions & 4 deletions grass7/imagery/i.modis/libmodis/rmodislib.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ def returned(self):
elif list(self.products_swath.keys()).count(self.prod) == 1:
return self.products_swath[self.prod]
else:
grass.fatal(_("The MODIS product inserted is not supported yet. "
grass.fatal(_("The MODIS product ({}) inserted is not supported yet. "
"Consider to ask on the grass-dev mailing list "
"for future support"))
"for future support").format(self.prod))

def fromcode(self, code):
for k, v in self.products.items():
Expand All @@ -315,9 +315,9 @@ def fromcode(self, code):
for k, v in self.products_swath.items():
if v['prod'].find(code) != -1:
return self.products_swath[k]
grass.fatal(_("The MODIS product inserted is not supported yet. "
grass.fatal(_("The MODIS product ({}) inserted is not supported yet. "
"Consider to ask on the grass-dev mailing list "
"for future support"))
"for future support").format(code))

def color(self, code=None):
if code:
Expand Down

0 comments on commit 6dbef44

Please sign in to comment.