Skip to content

Commit

Permalink
g.gui.gmodeler: fix script export not working if model contains Model…
Browse files Browse the repository at this point in the history
…Data-type item (#3209)
  • Loading branch information
pesekon2 authored Nov 2, 2023
1 parent cecd87b commit c99d03a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gui/wxpython/gmodeler/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2727,7 +2727,7 @@ def _handler(request, response):"""

self._writeHandler()

for item in self.model.GetItems():
for item in self.model.GetItems(ModelAction):
if item.GetParameterizedParams()["flags"]:
self.fd.write(
r"""
Expand Down Expand Up @@ -2860,7 +2860,7 @@ def _write_input_output_object(
)

def _writeHandler(self):
for item in self.model.GetItems():
for item in self.model.GetItems(ModelAction):
self._writeItem(item, variables=item.GetParameterizedParams())

self.fd.write("\n{}return response\n".format(" " * self.indent))
Expand Down Expand Up @@ -3128,7 +3128,7 @@ def _writePython(self):
)
)

modelItems = self.model.GetItems()
modelItems = self.model.GetItems(ModelAction)
for item in modelItems:
for flag in item.GetParameterizedParams()["flags"]:
if flag["label"]:
Expand Down Expand Up @@ -3224,7 +3224,7 @@ def cleanup():
self.fd.write(" pass\n")

self.fd.write("\ndef main(options, flags):\n")
for item in self.model.GetItems():
for item in self.model.GetItems(ModelAction):
self._writeItem(item, variables=item.GetParameterizedParams())

self.fd.write(" return 0\n")
Expand Down

0 comments on commit c99d03a

Please sign in to comment.