Kaynağa Gözat

grass.py: replace grass_intro.txt and welcome.txt files by included text

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49925 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 yıl önce
ebeveyn
işleme
fb55b987c5
4 değiştirilmiş dosya ile 18 ekleme ve 36 silme
  1. 1 3
      lib/init/Makefile
  2. 17 19
      lib/init/grass.py
  3. 0 13
      lib/init/grass_intro.txt
  4. 0 1
      lib/init/welcome.txt

+ 1 - 3
lib/init/Makefile

@@ -23,9 +23,7 @@ FILES = \
 	$(ETC)/lock$(EXE) \
 	$(ETC)/run$(EXE) \
 	$(ETC)/echo$(EXE) \
-	$(ETC)/grass_intro \
 	$(ETC)/license \
-	$(ETC)/welcome \
 	$(ETC)/VERSIONNUMBER \
 	$(ETC)/prompt.py \
 	$(HTMLDIR)/help_loc_struct.png \
@@ -105,7 +103,7 @@ $(ETC)/VERSIONNUMBER:
 	fi
 	chmod +r $@
 
-$(ETC)/grass_intro $(ETC)/license $(ETC)/welcome: $(ETC)/%: %.txt version.sed 
+$(ETC)/license: $(ETC)/%: %.txt version.sed
 	rm -f $@
 	sh ./version.sed "$(GRASS_VERSION_NUMBER)" "$(GRASS_VERSION_DATE)" "$(GRASS_VERSION_UPDATE_PKG)" $< > $@
 	chmod +r $@

+ 17 - 19
lib/init/grass.py

@@ -418,22 +418,27 @@ def set_browser():
     os.environ['GRASS_HTML_BROWSER'] = browser
 
 def grass_intro():
-    if locale:
-	path = gfile("locale", locale, "etc", "grass_intro")
-	if not os.access(path, os.R_OK):
-	    path = gfile("etc", "grass_intro")
-    else:
-	path = gfile("etc", "grass_intro")
-    f = open(path, 'r')
-    for line in f:
-	sys.stderr.write(line)
-    f.close()
+    intro = r"""
+WELCOME TO GRASS %s
+
+   1) Have at your side all available GRASS tutorials
+
+   2) When working on your location, the following materials
+      are extremely useful:
+      - A topo map of your area
+      - Current catalog of available computer maps
+
+   3) Check the GRASS webpages for feedback mailinglists and more:
+      http://grass.osgeo.org
+      http://www.grass-gis.org
+""" % grass_version
+    sys.stderr.write(intro)
     
     sys.stderr.write("\n")
     sys.stderr.write(_("Hit RETURN to continue"))
     sys.stdin.readline()
     
-    #for convenience, define pwd as GISDBASE:
+    # for convenience, define pwd as GISDBASE:
     s = r"""GISDBASE: %s
 LOCATION_NAME: <UNKNOWN>
 MAPSET: <UNKNOWN>
@@ -747,14 +752,7 @@ def show_banner():
 
 
 def say_hello():
-    if locale:
-	path = gfile("locale", locale, "etc", "welcome")
-	if not os.access(path, os.R_OK):
-	    path = gfile("etc", "welcome")
-    else:
-	path = gfile("etc", "welcome")
-    s = readfile(path)
-    sys.stderr.write(s)
+    sys.stderr.write(_("Welcome to GRASS %s") % grass_version)
 
 def show_info():
     sys.stderr.write(

+ 0 - 13
lib/init/grass_intro.txt

@@ -1,13 +0,0 @@
-
-WELCOME TO GRASS GRASS_VERSION_NUMBER (GRASS_VERSION_DATE)
-
-   1) Have at your side all available GRASS tutorials
-
-   2) When working on your location, the following materials
-      are extremely useful:
-      - A topo map of your area
-      - Current catalog of available computer maps
-
-   3) Check the GRASS webpages for feedback mailinglists and more:
-      http://grass.osgeo.org
-      http://www.grass-gis.org

+ 0 - 1
lib/init/welcome.txt

@@ -1 +0,0 @@
-Welcome to GRASS GRASS_VERSION_NUMBER (GRASS_VERSION_DATE) GRASS_VERSION_UPDATE_PKG