Skip to content

Commit

Permalink
GUI: sync GConsole skipInterface handling with g.parser (OSGeo#3375)
Browse files Browse the repository at this point in the history
  • Loading branch information
landam committed Jan 26, 2024
1 parent 3e3845d commit aeb4081
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions gui/wxpython/core/gconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,14 +633,13 @@ def RunCmd(
skipInterface = True
if os.path.splitext(command[0])[1] in (".py", ".sh"):
try:
sfile = open(command[0], "r")
for line in sfile.readlines():
if len(line) < 2:
continue
if line[0] == "#" and line[1] == "%":
skipInterface = False
break
sfile.close()
with open(command[0], "r") as sfile:
for line in sfile.readlines():
if len(line) < 3:
continue
if line.startswith(("#%", "# %")):
skipInterface = False
break
except IOError:
pass

Expand Down

0 comments on commit aeb4081

Please sign in to comment.