[GRASS-SVN] r42536 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jun 9 09:32:33 EDT 2010


Author: neteler
Date: 2010-06-09 09:32:32 -0400 (Wed, 09 Jun 2010)
New Revision: 42536

Modified:
   grass/trunk/lib/init/grass.py
Log:
alf: wait for the batch job to be finished; don't open GUI in batch mode

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2010-06-09 12:33:46 UTC (rev 42535)
+++ grass/trunk/lib/init/grass.py	2010-06-09 13:32:32 UTC (rev 42536)
@@ -613,10 +613,13 @@
 	    # right file, but ...
 	    fatal(_("Change file permission to 'executable' for '%s'") % batch_job)
 	else:
-	    message(_("Executing '%s'...") % batch_job)
+	    message(_("Executing '%s' ...") % batch_job)
 	    grass_gui = "text"
-	    Popen(batch_job, shell = True)
-    
+	    shell = batch_job
+	    bj = Popen(shell,shell=True)
+	    bj.wait()
+	    message(_("Execution of '%s' finished.") % batch_job)
+
 def start_gui():
     # Start the chosen GUI but ignore text
     if grass_debug:
@@ -968,13 +971,19 @@
 
 check_batch_job()
 
-start_gui()
+if not batch_job:	
+    start_gui()
 
 clear_screen()
 
 # Display the version and license info
 if batch_job:
     say_hello()
+    grass_gui = 'text'
+    clear_screen()
+    clean_temp()
+    try_remove(lockfile)
+    sys.exit(0)
 else:
     show_banner()
     say_hello()



More information about the grass-commit mailing list