[GRASS-SVN] r39095 - grass/branches/develbranch_6/tools
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Sep 9 22:44:15 EDT 2009
Author: hamish
Date: 2009-09-09 22:44:12 -0400 (Wed, 09 Sep 2009)
New Revision: 39095
Modified:
grass/branches/develbranch_6/tools/module_synopsis.sh
Log:
module specific tweaks;
rarrow multi-level menu depth for TeX;
more space between menu words in TeX
Modified: grass/branches/develbranch_6/tools/module_synopsis.sh
===================================================================
--- grass/branches/develbranch_6/tools/module_synopsis.sh 2009-09-09 15:44:53 UTC (rev 39094)
+++ grass/branches/develbranch_6/tools/module_synopsis.sh 2009-09-10 02:44:12 UTC (rev 39095)
@@ -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
@@ -196,10 +210,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>
@@ -398,13 +413,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