Bläddra i källkod

r.usler: don't use _() for option->key
use standardized messages, html tags in manual page


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33832 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 år sedan
förälder
incheckning
5d2ce50f04
2 ändrade filer med 33 tillägg och 31 borttagningar
  1. 21 19
      raster/r.usler/main.c
  2. 12 12
      raster/r.usler/r.usler.html

+ 21 - 19
raster/r.usler/main.c

@@ -47,25 +47,27 @@ int main(int argc, char *argv[])
     G_gisinit(argv[0]);
 
     module = G_define_module();
-    module->keywords = _("rainfall, erosion, USLE");
-    module->description = _("raster, USLE R factor, Rainfall erosivity index.");
+    module->keywords = _("raster, rainfall, erosion, USLE");
+    module->description = _("Computes USLE R factor, Rainfall erosivity index.");
     
+    input2 = G_define_standard_option(G_OPT_R_INPUT);
+    input2->description = _("Name of the annual precipitation map");
+
+    output = G_define_standard_option(G_OPT_R_OUTPUT);
+
     /* Define the different options */ 
     input1 = G_define_option();
-    input1->key = _("method");
+    input1->key = "method";
     input1->type = TYPE_STRING;
     input1->required = YES;
-    input1->gisprompt = _("Name of method to use");
-    input1->description =
-	_("Name of USLE R equation: roose, morgan, foster, elswaify.");
-    input1->answer = _("morgan");
-
-    input2 = G_define_standard_option(G_OPT_R_INPUT);
-    input2->description = _("Name of the annual precipitation map");
+    input1->description = _("Name of USLE R equation");
+    input1->options = "roose, morgan, foster, elswaify";
+    input1->descriptions = _("roose;Roosle (1975);"
+			     "morgan;Morgan (1974);"
+			     "foster;Foster(1981);"
+			     "elswaify;El-Swaify (1985)");
+    input1->answer = "morgan";
 
-    output = G_define_standard_option(G_OPT_R_OUTPUT);
-    output->description = _("Name of the output usler layer");
-    
     /********************/ 
     if (G_parser(argc, argv))
         exit(EXIT_FAILURE);
@@ -76,7 +78,7 @@ int main(int argc, char *argv[])
     
     /***************************************************/ 
     if ((infd_annual_pmm = G_open_cell_old(annual_pmm, "")) < 0)
-	G_fatal_error(_("Cannot open cell file [%s]"), annual_pmm);
+	G_fatal_error(_("Unable to open raster map <%s>"), annual_pmm);
     inrast_annual_pmm = G_allocate_d_raster_buf();
     
     /***************************************************/ 
@@ -86,7 +88,7 @@ int main(int argc, char *argv[])
     
     /* Create New raster files */ 
     if ((outfd = G_open_raster_new(result, DCELL_TYPE)) < 0)
-	G_fatal_error(_("Could not open <%s>"), result);
+	G_fatal_error(_("Unable to create raster map <%s>"), result);
     
     /* Process pixels */ 
     for (row = 0; row < nrows; row++)
@@ -97,7 +99,8 @@ int main(int argc, char *argv[])
 	
 	/* read input map */ 
 	if (G_get_d_raster_row(infd_annual_pmm, inrast_annual_pmm, row) < 0)
-	    G_fatal_error(_("Could not read from <%s>"), annual_pmm);
+	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
+			  annual_pmm, row);
 	
 	/*process the data */ 
 	for (col = 0; col < ncols; col++)
@@ -121,7 +124,8 @@ int main(int argc, char *argv[])
 		    d = elswaify_1985(d_annual_pmm);
 	    }
 	if (G_put_d_raster_row(outfd, outrast) < 0)
-	    G_fatal_error(_("Cannot write to output raster file"));
+	    G_fatal_error(_("Failed writing raster map <%s> row %d"),
+			  result, row);
 	}
     }
     G_free(inrast_annual_pmm);
@@ -135,5 +139,3 @@ int main(int argc, char *argv[])
 
     exit(EXIT_SUCCESS);
 }
-
-

+ 12 - 12
raster/r.usler/r.usler.html

@@ -1,24 +1,24 @@
-<H2>DESCRIPTION</H2>
+<h2>DESCRIPTION</h2>
 
-<EM>r.usler</EM> calculates USLE R factor for Rainfall erosivity. It enables several empirical equations: Roosle (1975), Morgan (1974), Foster(1981) and El-Swaify (1985).
+<em>r.usler</em> calculates USLE R factor for Rainfall erosivity. It
+enables several empirical equations: Roosle (1975), Morgan (1974),
+Foster(1981) and El-Swaify (1985).
 
-<H2>NOTES</H2>
+<h2>NOTES</h2>
 
-<H2>TODO</H2>
+<h2>TODO</h2>
 
-
-<H2>SEE ALSO</H2>
+<h2>SEE ALSO</h2>
 
 <em>
-<A HREF="r.uslek.html">r.uslek</A><br>
-<A HREF="r.watershed.html">r.watershed</A><br>
+  <a href="r.uslek.html">r.uslek</a>,
+  <a href="r.watershed.html">r.watershed</a
 </em>
 
 
-<H2>AUTHORS</H2>
-Natialia Medvedeva, SIC-ISDC, Ashgabat, Turkmenistan<BR>
-Yann Chemin, SIC-ISDC, Ashgabat, Turkmenistan<BR>
-
+<h2>AUTHORS</h2>
+Natialia Medvedeva, SIC-ISDC, Ashgabat, Turkmenistan<br>
+Yann Chemin, SIC-ISDC, Ashgabat, Turkmenistan
 
 <p>
 <i>Last changed: $Date: 2008/10/12 08:30:42 $</i>