Selaa lähdekoodia

grass-gxm.dtd added, some tags renamed

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41820 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 vuotta sitten
vanhempi
commit
d0a4529eac
2 muutettua tiedostoa jossa 70 lisäystä ja 8 poistoa
  1. 7 8
      gui/wxpython/gui_modules/gmodeler.py
  2. 63 0
      gui/wxpython/xml/grass-gxm.dtd

+ 7 - 8
gui/wxpython/gui_modules/gmodeler.py

@@ -1133,7 +1133,7 @@ class ProcessModelFile:
         """!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 @@ class ProcessModelFile:
                 
             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 @@ class WriteModelFile:
                               (' ' * 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

+ 63 - 0
gui/wxpython/xml/grass-gxm.dtd

@@ -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>