Skip to content

Commit

Permalink
adjust re pasing
Browse files Browse the repository at this point in the history
  • Loading branch information
anikaweinmann committed Jan 4, 2024
1 parent 1810ea3 commit 813958f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ def main():
except Exception:
# for execution in GUI
tile_output = re.search(r"Output is: <(.*?)>", msg).groups()[0]

output_list.append(tile_output)

# verify that switching back to original mapset worked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,12 @@ def main():
grass.message(_(msg_part))
# create mapset dict based on Log, so that only those with output are listed
if "Skipping..." not in msg:
tile_output = re.search(r"Output is:\n<(.*?)>", msg).groups()[0]
try:
# for execution in terminal
tile_output = re.search(r"Output is:\n<(.*?)>", msg).groups()[0]
except Exception:
# for execution in GUI
tile_output = re.search(r"Output is: <(.*?)>", msg).groups()[0]
output_list.append(tile_output)
if flags["q"]:
area_identified = re.search(
Expand Down
17 changes: 14 additions & 3 deletions grass-gis-addons/m.analyse.trees/v.trees.cd/v.trees.cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,20 @@ def main():
grass.message(_(msg_part))
# create mapset dict based on Log
if "Skipping..." not in msg:
tile_output = (
re.search(r"Output is:\n<(.*?)>", msg).groups()[0].split(",")
)
try:
# for execution in terminal
tile_output = (
re.search(r"Output is:\n<(.*?)>", msg)
.groups()[0]
.split(",")
)
except Exception:
# for execution in GUI
tile_output = (
re.search(r"Output is: <(.*?)>", msg)
.groups()[0]
.split(",")
)
for ind, el in enumerate(output_suffix):
if tile_output[ind]:
output_dict[el].append(tile_output[ind])
Expand Down

0 comments on commit 813958f

Please sign in to comment.