[GRASS-SVN] r49431 - grass/trunk/gui/wxpython/gmodeler
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Nov 30 06:11:59 EST 2011
Author: martinl
Date: 2011-11-30 03:11:59 -0800 (Wed, 30 Nov 2011)
New Revision: 49431
Modified:
grass/trunk/gui/wxpython/gmodeler/dialogs.py
grass/trunk/gui/wxpython/gmodeler/model.py
grass/trunk/gui/wxpython/gmodeler/model_file.py
Log:
wxGUI/gmodeler: fix loading models
Modified: grass/trunk/gui/wxpython/gmodeler/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/dialogs.py 2011-11-30 10:54:45 UTC (rev 49430)
+++ grass/trunk/gui/wxpython/gmodeler/dialogs.py 2011-11-30 11:11:59 UTC (rev 49431)
@@ -31,6 +31,7 @@
from gui_core.dialogs import ElementDialog, MapLayersDialog
from gui_core.ghelp import SearchModuleWindow
from gui_core.prompt import GPromptSTC
+from gui_core.forms import CmdPanel
from grass.script import task as gtask
@@ -430,7 +431,7 @@
task.flags = params['flags']
task.params = params['params']
- panel = menuform.cmdPanel(parent = self, id = wx.ID_ANY, task = task)
+ panel = CmdPanel(parent = self, id = wx.ID_ANY, task = task)
self.tasks.append(task)
return panel
Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py 2011-11-30 10:54:45 UTC (rev 49430)
+++ grass/trunk/gui/wxpython/gmodeler/model.py 2011-11-30 11:11:59 UTC (rev 49431)
@@ -25,6 +25,7 @@
import getpass
import copy
import re
+import mimetypes
try:
import xml.etree.ElementTree as etree
except ImportError:
@@ -33,9 +34,13 @@
import wx
from wx.lib import ogl
-from core.globalvar import ETCWXDIR
-from core.gcmd import GMessage, GException, GError, RunCommand
-from gmodeler.dialogs import ModelParamDialog
+from core.globalvar import ETCWXDIR
+from core.gcmd import GMessage, GException, GError, RunCommand
+from gmodeler.dialogs import ModelParamDialog
+from gmodeler.model_file import ProcessModelFile
+from core.utils import CmdToTuple
+from core.settings import UserSettings
+from gui_core.forms import GUI
from grass.script import core as grass
from grass.script import task as gtask
@@ -358,7 +363,7 @@
for action in self.GetItems(objType = ModelAction):
cmd = action.GetLog(string = False)
- task = menuform.GUI(show = None).ParseCommand(cmd = cmd)
+ task = GUI(show = None).ParseCommand(cmd = cmd)
errList += map(lambda x: cmd[0] + ': ' + x, task.get_cmd_error())
# check also variables
@@ -581,9 +586,10 @@
condVar, condText = map(lambda x: x.strip(), re.split('\s*in\s*', cond))
pattern = re.compile('%' + condVar)
### for vars()[condVar] in eval(condText): ?
+ vlist = list()
if condText[0] == '`' and condText[-1] == '`':
# run command
- cmd, dcmd = utils.CmdToTuple(condText[1:-1].split(' '))
+ cmd, dcmd = CmdToTuple(condText[1:-1].split(' '))
ret = RunCommand(cmd,
read = True,
**dcmd)
Modified: grass/trunk/gui/wxpython/gmodeler/model_file.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model_file.py 2011-11-30 10:54:45 UTC (rev 49430)
+++ grass/trunk/gui/wxpython/gmodeler/model_file.py 2011-11-30 11:11:59 UTC (rev 49431)
@@ -20,6 +20,7 @@
import time
import re
+from core import utils
from gui_core.forms import GUI
from core.gcmd import GWarning, EncodeString
More information about the grass-commit
mailing list