[GRASS-SVN] r74057 - grass/trunk/gui/wxpython/gmodeler

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 5 03:57:49 PST 2019


Author: pesekon2
Date: 2019-02-05 03:57:49 -0800 (Tue, 05 Feb 2019)
New Revision: 74057

Modified:
   grass/trunk/gui/wxpython/gmodeler/model.py
Log:
reflect global overwrite flag in modeler python export, fix #3729

Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py	2019-02-05 11:39:32 UTC (rev 74056)
+++ grass/trunk/gui/wxpython/gmodeler/model.py	2019-02-05 11:57:49 UTC (rev 74057)
@@ -2681,9 +2681,13 @@
 if __name__ == "__main__":
     options, flags = parser()
     atexit.register(cleanup)
-    sys.exit(main(options, flags))
 """)
 
+        if properties.get('overwrite'):
+            self.fd.write('    os.environ["GRASS_OVERWRITE"] = "1"\n')
+
+        self.fd.write('    sys.exit(main())\n')
+
     def _writePythonItem(self, item, ignoreBlock=True, variables={}):
         """Write model object to Python file"""
         if isinstance(item, ModelAction):



More information about the grass-commit mailing list