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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 7 07:38:19 EST 2008


Author: martinl
Date: 2008-01-07 07:38:19 -0500 (Mon, 07 Jan 2008)
New Revision: 29593

Added:
   grass/trunk/gui/xml/Makefile
Removed:
   grass/trunk/gui/wxpython/gui_modules/grass-interface.dtd
Modified:
   grass/trunk/gui/Makefile
   grass/trunk/gui/wxpython/gui_modules/gcmd.py
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
Redundant grass-interface.dtd file removed from gui/wxpython/gui_modules, install gui/xml/grass-interface.dtd to $ETC.


Modified: grass/trunk/gui/Makefile
===================================================================
--- grass/trunk/gui/Makefile	2008-01-07 12:29:56 UTC (rev 29592)
+++ grass/trunk/gui/Makefile	2008-01-07 12:38:19 UTC (rev 29593)
@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ..
 
-SUBDIRS = icons scripts
+SUBDIRS = icons scripts xml
 
 TCLTKBASED = tcltk
 PYTHONBASED = wxpython

Modified: grass/trunk/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcmd.py	2008-01-07 12:29:56 UTC (rev 29592)
+++ grass/trunk/gui/wxpython/gui_modules/gcmd.py	2008-01-07 12:38:19 UTC (rev 29593)
@@ -46,7 +46,7 @@
 from debug import Debug as Debug
 
 class Popen(subprocess.Popen):
-    """Subclass Popen..."""
+    """Subclass subprocess.Popen"""
     def recv(self, maxsize=None):
         return self._recv('stdout', maxsize)
     
@@ -152,17 +152,8 @@
     """
     Run GRASS command in separate thread
 
-    Parameters:
-    cmd     - command given as list
-    stdin   - standard input stream
-    verbose - verbose mode [0, 3]
-    wait    - wait for child execution terminated
-    dlgMsg  - type of error message (None, gui, txt), only if wait is True
-    stdout  - redirect standard output or None
-    stderr  - redirect standard error output or None
+    If stdout/err is redirected, write() method is required for the given classes
 
-    If stdout/err is redirected, write() method is required for the given classes.
-
     Usage:
         cmd = Command(cmd=['d.rast', 'elevation.dem'], verbose=3, wait=True)
 
@@ -173,6 +164,13 @@
         else:
             print 'FAILURE (%d)' % cmd.returncode
 
+    @param cmd     command given as list
+    @param stdin   standard input stream
+    @param verbose verbose level [0, 3] (--q, --v)
+    @param wait    wait for child execution terminated
+    @param log     logging type (None, gui, txt), only if wait is True
+    @param stdout  redirect standard output or None
+    @param stderr  redirect standard error output or None
     """
     def __init__ (self, cmd, stdin=None,
                   verbose=None, wait=True, log='gui',

Deleted: grass/trunk/gui/wxpython/gui_modules/grass-interface.dtd
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/grass-interface.dtd	2008-01-07 12:29:56 UTC (rev 29592)
+++ grass/trunk/gui/wxpython/gui_modules/grass-interface.dtd	2008-01-07 12:38:19 UTC (rev 29593)
@@ -1,156 +0,0 @@
-<!--	grass-interface.dtd
-
-	Copyright (C) 2000-2007 by the GRASS Development Team
-	Author: Jan-Oliver Wagner <jan intevation.de>
-	
-	Changes: 
-	2007-10 by Martin Landa <landa.martin gmail.com>
-	   * added keywords element
-	   * added name element (fix for value element)
-
-	2007-04 by Daniel Calvelo <dca.gis gmail.com>
-	   * added guisection element
-	   * added name-description pair for value sets
-
-	2001-06-07 by Eric G. Miller <egm2 jps.net>
-	   * make <parameter-group> optional
-	   * move descriptions first, always optional
-	   * make <default> optional  // Should it reference <value> ?
-	   
-	2001-07-09:
-	   * Make an explicit flag element
-	   * make keydesc and gispropmpt elements
-	   * move elements directly under "task"
-
-	This program is free software under the GPL (>=v2)
-	Read the file COPYING coming with GRASS for details.
--->
-
-
-<!--	a grass-interface collect several tasks to
-	customize a grass application.
--->
-<!ELEMENT grass-interface (description? , task+)>
-<!ATTLIST grass-interface	name	CDATA #REQUIRED>
-
-
-<!--	a task describes the interface of a single
-	GRASS command. It may consist of several
-	groups of parameters. Grouping is only for
-	semantic purposes in the (G)UI.
-	The task may optionally have a description.
-	The name of the task is the identifier
-	for the GRASS command and is used
-	to execute the task.
--->
-<!ELEMENT task	        (description?, keywords?, parameter*, flag*, parameter-group*)>
-<!ATTLIST task	name	CDATA #REQUIRED>
-
-
-
-<!--	a parameter-group may be associated with a name,
-	but the name is not necessary for running a
-	GRASS command.
-	The group consists of a number of parameters
-	and may optionally have a description.
--->
-<!ELEMENT parameter-group       (description?, parameter*, flag*)>
-<!ATTLIST parameter-group	name	CDATA	#IMPLIED>
-
-
-<!--	a parameter must have a name and a description.
-	the name is the parameter identifier when calling
-	the command.
-	A default may be provided. values can be given
-	as parameter options.
-	Parameters can be optional and in that case can be
-	ignored executing the task when not entered in the (G)UI.
-	Any parameter has one of these (default is string):
-	string		: a string parameter.
-	integer		: a numeric integer parameter.
-	float		: a numeric float parameter.
-	If multiple is "yes", then many values for the
-	parameter may be given in a comma-seperated list
--->
-<!ELEMENT parameter     (description?, keydesc?, gisprompt?, default?, values?, guisection?)>
-<!ATTLIST parameter	name		CDATA #REQUIRED
-			type		(string | integer | float) "string"
-			required	(yes | no) "no"
-			multiple	(yes | no) "no">
-
-<!--    The "keydesc" defines a tuple for input, such as "x,y".
-	The program expects a comma separated list with matching
-	count of items (or multiples thereof, if multiple is true).
--->
-<!ELEMENT keydesc      (item+)>
-
-
-<!--    An "item" is a value for a tuple of keydesc.
-        It must have an "order" attribute, to insure sort ordering
--->
-<!ELEMENT item         (#PCDATA)>
-<!ATTLIST item         order          CDATA #REQUIRED>
-
-
-<!--    The "gisprompt" is a three part description, used for map elements
-	and files.  It consists of a comma separated list of 
-	"age,element,prompt".  "Age" is "new | old | any"; "element" is
-	a grass map element such as "dig", and "prompt" is what to present
-	to the user in a prompt, such as "vector"
--->
-<!ELEMENT gisprompt    EMPTY>
-<!ATTLIST gisprompt    age            (any | old | new | mapset) #REQUIRED
-                       element        (cell | fcell | cellhd | cats | colr |
-                                       colr2 | cell_misc | hist | dig | dig_ascii |
-                                       dig_att | dig_cats | dig_plus | reg | arc |
-                                       bldg | dlg | dxf | camera | icons | paint |
-                                       group | site_lists | windows | CDATA) #REQUIRED
-                       prompt         CDATA #REQUIRED>
-
-<!--    A flag must have a name and should have a description.
-        It's a toggle that is off by default
--->
-<!ELEMENT flag         (description?)>
-<!ATTLIST flag         name            CDATA #REQUIRED>
-
-        
-<!--	a default of a parameter. Hopefully it does correspond
-	with the parameter type. How to set up rules for that
-	(same problem for <value>)?
--->
-<!ELEMENT default    (#PCDATA)>
-
-<!--	the GUI section where the parameter would appear
--->
-<!ELEMENT guisection	(#PCDATA)>
-
-<!--	contains a number of single values. Values may have name and description.
--->
-<!ELEMENT values     (value+)>
-
-
-
-<!--	a potential value for a parameter. Hopefully
-	it does correpond to the parameter type.
-	How to set up rules for that (same problem for
-	<default>)?
--->
-<!ELEMENT value	    (name, description?)>
-<!ELEMENT name          (#PCDATA)>
-
-
-
-<!-- common elements -->
-
-
-
-<!--	text that describes a grass-interface, task,
-	parameter-group or parameter.
--->
-<!ELEMENT description   (#PCDATA)>
-
-
-
-<!--	list of keywords that describes a task
--->
-<!ELEMENT keywords   (#PCDATA)>

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-01-07 12:29:56 UTC (rev 29592)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-01-07 12:38:19 UTC (rev 29593)
@@ -1178,12 +1178,12 @@
     """
     Returns the XML description for the GRASS cmd.
 
-    The DTD must be located in $GISBASE/etx/wx/gui_modules/grass-interface.dtd,
+    The DTD must be located in $GISBASE/etc/grass-interface.dtd,
     otherwise the parser will not succeed.
 
     Note: 'cmd' is given as string
     """
-    gmpath = os.path.join(wxbase,"gui_modules")
+    gmpath = os.path.join(gisbase, "etc")
     cmdout = os.popen(cmd + r' --interface-description', "r").read()
     if not len(cmdout) > 0 :
         raise IOError, _("Couldn't fetch interface description for command <%s>.") % cmd

Added: grass/trunk/gui/xml/Makefile
===================================================================
--- grass/trunk/gui/xml/Makefile	                        (rev 0)
+++ grass/trunk/gui/xml/Makefile	2008-01-07 12:38:19 UTC (rev 29593)
@@ -0,0 +1,8 @@
+MODULE_TOPDIR = ../..
+
+include $(MODULE_TOPDIR)/include/Make/Dir.make
+
+default: $(ETC)/grass-interface.dtd 
+
+$/$(ETC)/grass-interface.dtd : grass-interface.dtd 
+	$(INSTALL_DATA) grass-interface.dtd $(ETC)/grass-interface.dtd 



More information about the grass-commit mailing list