Преглед изворни кода

more precise name for shell variable names.
strip pretty-text out of shell script output, quote date string.


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

Hamish Bowman пре 14 година
родитељ
комит
25a8c1857f
3 измењених фајлова са 8 додато и 8 уклоњено
  1. 4 4
      general/g.version/main.c
  2. 2 2
      gui/wxpython/gui_modules/ghelp.py
  3. 2 2
      lib/python/core.py

+ 4 - 4
general/g.version/main.c

@@ -7,7 +7,7 @@
 *  	    	Justin Hickey - Thailand - jhickey hpcc.nectec.or.th
 * PURPOSE: 	Output GRASS version number, date and copyright message.
 *             
-* COPYRIGHT:  	(C) 2000-2009, 2011 by the GRASS Development Team
+* COPYRIGHT:  	(C) 2000-2011 by the GRASS Development Team
 *
 *   	    	This program is free software under the GPL (>=v2)
 *   	    	Read the file COPYING that comes with GRASS for details.
@@ -91,11 +91,11 @@ int main(int argc, char *argv[])
 	char **rev_ver = G_tokenize(GIS_H_VERSION, "$");
 	char **rev_time = G_tokenize(GIS_H_DATE, "$");
 	if (shell->answer) {
-	    fprintf(stdout, "gis_revision=%s\n", rev_ver[1]);
-	    fprintf(stdout, "gis_date=%s\n", rev_time[1]);
+	    fprintf(stdout, "libgis_revision=%s\n", strstr(rev_ver[1], " ") + 1);
+	    fprintf(stdout, "libgis_date=\"%s\"\n", strstr(rev_time[1], " ") + 1);
 	}
 	else {
-	    fprintf(stdout, "%s\n%s\n", rev_ver[1], rev_time[1]);
+	    fprintf(stdout, "libgis %s\nlibgis %s\n", rev_ver[1], rev_time[1]);
 	}
 	G_free_tokens(rev_ver);
 	G_free_tokens(rev_time);

+ 2 - 2
gui/wxpython/gui_modules/ghelp.py

@@ -527,8 +527,8 @@ class AboutWindow(wx.Frame):
                           flag = wx.ALIGN_RIGHT)
         
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
-                                               label = svn_gis_h_rev.split(' ')[1] + ' (' +
-                                               svn_gis_h_date.split(' ')[1] + ')'),
+                                               label = svn_gis_h_rev.split(' ')[2] + ' (' +
+                                               svn_gis_h_date.split(' ')[2] + ')'),
                           pos = (2, 1),
                           flag = wx.ALIGN_LEFT)
 

+ 2 - 2
lib/python/core.py

@@ -1074,8 +1074,8 @@ def version():
     @code
     version()
 
-    {'date': '2011', 'gis_revision': 'Revision: 45093 ', 'version': '7.0.svn',
-     'gis_date': 'Date: 2011-01-20 13:10:50 +0100 (Thu, 20 Jan 2011) ', 'revision': '45136M'}
+    {'date': '2011', 'libgis_revision': '45093 ', 'version': '7.0.svn',
+     'libgis_date': '2011-01-20 13:10:50 +0100 (Thu, 20 Jan 2011) ', 'revision': '45136M'}
     @endcode
     """
     return parse_command('g.version',