[GRASS-SVN] r41820 - in grass/trunk/gui/wxpython: gui_modules xml

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 12 11:07:11 EDT 2010


Author: martinl
Date: 2010-04-12 11:07:10 -0400 (Mon, 12 Apr 2010)
New Revision: 41820

Added:
   grass/trunk/gui/wxpython/xml/grass-gxm.dtd
Modified:
   grass/trunk/gui/wxpython/gui_modules/gmodeler.py
Log:
grass-gxm.dtd added, some tags renamed


Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py	2010-04-12 13:58:40 UTC (rev 41819)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py	2010-04-12 15:07:10 UTC (rev 41820)
@@ -1133,7 +1133,7 @@
         """!Process model file"""
         for data in self.root.findall('data'):
             pos, size = self._getDim(data)
-            param = data.find('parameter')
+            param = data.find('data-parameter')
             name = prompt = value = None
             if param is not None:
                 name = param.get('name', None)
@@ -1142,7 +1142,7 @@
                 
             aId = list()
             fromDir = list()
-            for action in data.findall('action'):
+            for action in data.findall('data-action'):
                 aId.append(int(action.get('id', None)))
                 if action.get('dir', 'to') == 'to':
                     fromDir.append(False)
@@ -1256,23 +1256,22 @@
                               (' ' * self.indent, data.GetX(), data.GetY(),
                                data.GetWidth(), data.GetHeight()))
             self.indent += 4
-            self.fd.write('%s<parameter name="%s" prompt="%s">\n' % \
+            self.fd.write('%s<data-parameter name="%s" prompt="%s">\n' % \
                               (' ' * self.indent, data.GetName(), data.GetPrompt()))
             self.indent += 4
             self.fd.write('%s<value>%s</value>\n' %
                           (' ' * self.indent, self._filterValue(data.GetValue())))
             self.indent -= 4
-            self.fd.write('%s</parameter>\n' % (' ' * self.indent))
-            self.indent -= 4
+            self.fd.write('%s</data-parameter>\n' % (' ' * self.indent))
             for action in data.GetActions('from'):
                 id = action.GetId()
-                self.fd.write('%s<action id="%d" dir="from" />\n' % \
+                self.fd.write('%s<data-action id="%d" dir="from" />\n' % \
                                   (' ' * self.indent, id))
             for action in data.GetActions('to'):
                 id = action.GetId()
-                self.fd.write('%s<action id="%d" dir="to" />\n' % \
+                self.fd.write('%s<data-action id="%d" dir="to" />\n' % \
                                   (' ' * self.indent, id))
-            
+            self.indent -= 4
             self.fd.write('%s</data>\n' % (' ' * self.indent))
             
         self.indent -= 4

Added: grass/trunk/gui/wxpython/xml/grass-gxm.dtd
===================================================================
--- grass/trunk/gui/wxpython/xml/grass-gxm.dtd	                        (rev 0)
+++ grass/trunk/gui/wxpython/xml/grass-gxm.dtd	2010-04-12 15:07:10 UTC (rev 41820)
@@ -0,0 +1,63 @@
+<!--	grass-gxm.dtd
+
+	Copyright (C) 2010 by the GRASS Development Team
+	Author: Martin Landa <landa.martin gmail.com>
+	
+	This program is free software under the GPL (>=v2)
+	Read the file COPYING coming with GRASS for details.
+-->
+
+
+<!--
+        grass-gxm defines model file content
+-->
+
+<!ELEMENT grass-gxm (gxm)>
+
+<!ELEMENT gxm (action*, data*)>
+
+<!--    an action defines action properties (usually GRASS modules)
+-->
+<!ELEMENT action (task)>
+<!ATTLIST action id	CDATA #REQUIRED>
+<!ATTLIST action name	CDATA #REQUIRED>
+<!ATTLIST action pos	CDATA #REQUIRED>
+<!ATTLIST action size	CDATA #REQUIRED>
+
+<!--	a task describes the interface of a single
+	GRASS command
+-->
+<!ELEMENT task	        (flag*, parameter*)>
+<!ATTLIST task	name	CDATA #REQUIRED>
+
+<!--	a parameter must have a name and a value
+-->
+<!ELEMENT parameter     (value)>
+<!ATTLIST parameter	name	CDATA #REQUIRED>
+
+<!--    value of parameter
+-->
+<!ELEMENT value         (#PCDATA)>
+
+<!--    enabled flag
+-->
+<!ELEMENT flag          EMPTY>
+<!ATTLIST flag          name    CDATA #REQUIRED>
+
+<!--    a data defines data properties (usually data layers)
+-->
+<!ELEMENT data (data-parameter, data-action*)>
+<!ATTLIST data pos	CDATA #REQUIRED>
+<!ATTLIST data size	CDATA #REQUIRED>
+
+<!--	a data-parameter defines data items properties
+-->
+<!ELEMENT data-parameter  (value)>
+<!ATTLIST data-parameter  name  	CDATA #REQUIRED>
+<!ATTLIST data-parameter  prompt	CDATA #REQUIRED>
+
+<!--	a data-action defines relation between data and actions
+-->
+<!ELEMENT data-action  EMPTY>
+<!ATTLIST data-action  id  	CDATA       #REQUIRED>
+<!ATTLIST data-action  dir	(from | to) #REQUIRED>



More information about the grass-commit mailing list