[GRASS-SVN] r39096 - grass/trunk/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 9 22:46:50 EDT 2009


Author: hamish
Date: 2009-09-09 22:46:50 -0400 (Wed, 09 Sep 2009)
New Revision: 39096

Modified:
   grass/trunk/tools/module_synopsis.sh
Log:
module specific tweaks;
rarrow multi-level menu depth for TeX;
more space between menu words in TeX
  (merge from devbr6)


Modified: grass/trunk/tools/module_synopsis.sh
===================================================================
--- grass/trunk/tools/module_synopsis.sh	2009-09-10 02:44:12 UTC (rev 39095)
+++ grass/trunk/tools/module_synopsis.sh	2009-09-10 02:46:50 UTC (rev 39096)
@@ -57,10 +57,8 @@
 OLDDIR="`pwd`"
 cd "$GISBASE"
 
-XML_MENU="$GISBASE/etc/wxpython/xml/menudata.xml"
 
-
-# generate menu hierarchy
+### generate menu hierarchy
 MDPY="$GISBASE/etc/wxpython/gui_modules/menudata.py"
 # python menudata.py commands
 # python menudata.py tree
@@ -69,16 +67,32 @@
   | sort -u > "$TMP.menu_hierarchy"
 
 
-
-# work in progress -- still rather buggy.
+### given a module name return where it is in the menu tree
 find_menu_hierarchy()
 {
   MODL=$1
-  PLACEMENT=`grep "^$MODL|" "$TMP.menu_hierarchy" | cut -f2 -d'|'`
 
+  # unwrap wrapper scripts
+  if [ "$MODL" = "g.gui" ] ; then
+    MODL="g.change.gui.py"
+  elif  [ "$MODL" = "v.type" ] ; then
+    MODL="v.type_wrapper.py"
+  fi
+
+  PLACEMENT=`grep "^$MODL|" "$TMP.menu_hierarchy" | cut -f2 -d'|' | head -n 1`
+
+  # combine some modules which are listed twice
+  if [ "$MODL" = "g.region" ] ; then
+      PLACEMENT=`echo "$PLACEMENT" | sed -e 's/Display/Set or Display/'`
+  elif  [ "$MODL" = "r.reclass" ] || [ "$MODL" = "v.reclass" ] ; then
+      PLACEMENT=`echo "$PLACEMENT" | sed -e 's/Reclassify.*$/Reclassify/'`
+  fi
+
   echo "$PLACEMENT"
 }
 
+
+### execute the loop for all modules
 for DIR in bin scripts ; do
   cd $DIR
 
@@ -193,10 +207,11 @@
 </center>
 <BR><BR><BR>
 
+<!--
 <i><font size="-1" color="#778877">
-   Menu position follows if available.</font></i>
-
+   Menu position follows description if applicable.</font></i>
 <BR><BR>
+-->
 
 <h4>Command types:</h4>
 <ul>
@@ -395,13 +410,13 @@
     grep "^${SECTION}\." "${TMP}.txt" | \
       sed -e 's/^/\\item [/' -e 's/: /]/' \
           -e 's+ {+ \\\\\n$+' -e 's/}$/$/' \
-	  -e 's+ > +\\,\\triangleright\\,|+' \
+	  -e 's+ > +\\,\\triangleright\\,|+g' \
           -e 's/\*/{*}/g' -e 's/_/\\_/g' -e 's/&/\\\&/g' \
 	| awk '/^\$/ { STR=$0; \
-		       gsub(" ", "\\, ", STR); \
-		       sub(/\|/," ",STR); \
-		       sub(/^/,"\\textcolor{DarkSeaGreen3}{\\footnotesize ",STR); \
-		       sub(/$/,"}",STR); \
+		       gsub(" ", "\\: ", STR); \
+		       gsub(/\|/, " ", STR); \
+		       sub(/^/, "\\textcolor{DarkSeaGreen3}{\\footnotesize ", STR); \
+		       sub(/$/, "}", STR); \
 		       print STR \
 		     } ;
 	       /^\\/ {print}' >> "${TMP}.tex"



More information about the grass-commit mailing list